Open Any man Page in Preview and Save as PDF
If you’re tired of looking over a man (manual) page within the Terminal, you can use a nifty command sequence to launch any specified man page into the Preview app of Mac OS X. This is done by piping the standard man output into the open command and Preview.
Launching the man Page into Preview
The exact syntax to use for this purpose is as follows:
man -t [COMMAND GOES HERE] | open -f -a /Applications/Preview.app
For example, this is using the trick to open the manual page for ‘ipconfig’ into Preview:
man -t ipconfig | open -f -a /Applications/Preview.app
You can do this with any page, just replace ‘ipconfig’ with any other command or known man page you’d like to read within Preview and it’ll work the same.
And yes, this is opening the manual page in Preview.app, the image editing and viewer app bundled with every version of Mac OS X… that may sound confusing and a bit weird to send a command line man document into an image editing app, but this is where things get particularly cool… you can export it as a PDF!
Essentially what you’re doing here is converting the manual page from a terminal text file into a PDF document.