0

I was reading the man page for firewalld.service and I wanted to open up the service.xml from within the man page (which I believe is less).

I know :e would do the job if I had permissions, but instead I had to drop out of the man page, and use sudo less .../service.xml

How do I avoid this in the future?

2

You can run an arbitrary command in man/less with an exclamation mark ("!").

Type

!sudo less .../service.xml

and press Enter to open a new less session as root within your unprivileged man or less.

  • I can't switch between files though, can I? – Pureferret Aug 24 '16 at 16:53
  • @Pureferret: Not easily, no. I would just open man with the right privileges or use a terminal multiplexer like byobu. – Deltik Aug 24 '16 at 20:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.