Convert man page to PDF

It’s fairly easy:
$ man -t bash | ps2pdf - bash.pdf

“man -t” uses groff -mandoc to format the manual page to stdout.

“ps2pdf – bash.pdf” means the input is from stdin and output to bash.pdf.

We use a simple pipe to join the stdout of “man” and stdin of “ps2pdf”.

That’s it!

2 thoughts on “Convert man page to PDF”

Leave a Reply

Your email address will not be published. Required fields are marked *

This work by Aron Xu is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported.