Man page to PS

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

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

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

zathura ls.1.ps # read the postscript with zathura.

ps2pdf ls.1.ps # convert to PDF

lpr ls.1.ps # send to lpr (printer)

--A man page printed on paper:

https://trisquel.info/files/manpage.jpg

--A man page viewed with zathura:

https://trisquel.info/files/zathura2.png

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

https://paedubucher.ch/articles/2020-09-20-basic-printing-on-openbsd.html

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

I am a member!

Offline
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).