«
»

Print a Man Page

March 5th, 2007 by George Notaras

Reading a man page using a terminal application is easy, but I doubt if it would ever win a convenience award. Sometimes, it is necessary to print the man page. I can recommend two ways of doing this.

First, using the -t switch, when launching the man command from a terminal, causes the man page to be formatted in Postscript. Technically, it uses groff to perform the conversion. More information about this can be found within the man command’s manual page (man 1 man).

The Postscript output can be piped to lpr for printing in a CUPS printer. The following example prints the iptables manual page to the HP690C printer:

$ man -t iptables | lpr -P HP690C

Alternatively, the output can be saved to a postscript file:

$ man -t iptables > iptables.ps

More on using a CUPS printer from the CLI can be found here.

Those who have the Yelp GNOME application installed, can take advantage of its internal man page parser and HTML converter. For example, in order to display the iptables man page in Yelp, launch it like the following:

$ yelp man:iptables

From there, you can use the GNOME print dialog to print the iptables manual.

I tend to prefer the quality of the man page when it has been printed through Yelp.

The Print a Man Page by George Notaras, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Terms and conditions beyond the scope of this license may be available at www.g-loaded.eu.

Related Articles

Tags: , , , , ,

Bookmark and Share

Comments are automatically disabled after a certain period of time. Further discussion about the published content is still possible though in the G-Loaded Forums.