The command man bash
produces a lot of output. What I desire would be to either search the results or print the results to paper. So, is there a way to convert a man page to a html and/or pdf document.
I would prefer the answer work for not only man bash
, but rather for any man page.
I know the output from man bash
has been posted on the internet, but usually these posts are not current.
Best Answer
Yes, there are numerous tools to convert manual pages to HTML and PDF.
UNIX Approach
Converting a man page to HTML, PDF, and text provides detailed instructions for macOS:
If the file ends in
.gz
, then substitute the following.For converting from HTML to PDF:
For other tool chains, see these related questions:
pandoc
Another approach is to use the popular pandoc tool. This tool can convert manual pages to a wide range of formats.
Link
x-man-page
macOS's Terminal.app offers a
x-man-page
URL scheme for pretty printing manual pages. Try opening the link below to see thels
man page: