Man page to PS

1 reply [Last post]
Joined: 02/17/2016

An easy way to print out UNIX command line man pages.

man -t ls > # print to postscript man page of command 'ls'

zathura # read the postscript with zathura.

ps2pdf # convert to PDF

lpr # send to lpr (printer)

--A man page printed on paper:

--A man page viewed with zathura:

I found out about this while on OBSD. On GNU/Linux, the syntax differs somewhat.

zathura2.png51.88 KB
manpage.jpg689.94 KB
Magic Banana

I am a member!

Joined: 07/24/2010

You can use pipes:
$ man -t ls | ps2pdf - ls.pdf
$ man -t ls | lpr

You can also substitute every "ls" with "$1" and write each of those lines in executable files, maybe named "man2pdf" and "man2lpr", that you can put in a directory listed in $PATH (so that you do not need to specify their paths to execute them).