Converting man pages to printable text and pdf files

To convert man pages of various Linux commands into a printable text file, use the following command:

$ man foo > man.txt

We can simply take a printout of the man.txt file, but the above step also copies unnecessary junk characters. In order to avoid this, the following command can be used.

$ man man | col -b > man.txt

man page to text or pdf file

Save the man page to text or pdf file

To convert man pages of various Linux commands into a pdf file, use the following command:

$ man -t man| ps2pdf ->  man.pdf

 In the above command, the output of  ‘man -t man’  is piped to the ps2pdf  program, which is then stored as man.pdf. This man.pdf file can be used like any other PDF file.

In fact, by this way we can prepare our own man page book  ;).

Quite handy, right ?

Advertisements

One thought on “Converting man pages to printable text and pdf files

  1. Extract Text from Protected PDF File. « Ramani's blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s