This blog has moved! Redirecting...
You should be automatically redirected. If not, visit http://scrolls.mafgani.net/ and update your bookmarks.

Thursday, March 08, 2007

Printing man pages

I never did this because I was too afraid about how many commands it would involve. Actually, it's extremely simple!

Let's say you have a printer installed by the name of "printer_1". If you want to print the contents of the man page related to chmod on this printer, do the following:


$ man -t chmod | lpr -P printer_1


Here, you are piping the contents of the chmod man page through lpr to the installed printer. If you don't use a printer name, the default printer will be used.

If instead of printing the contents out, you want to make a pdf file out of them, simply do


$ man -t chmod > chmod.ps && ps2pdf chmod.ps && rm chmod.ps

Labels: , , ,

0 Comments:

Post a Comment

<< Home