I had heard this question a lot of time and also seen people struggling to take the printout of Linux man pages, instead of the fact that it is one of the very simplest task.
This can be done in a series of steps or in one single steps. I will be explaining both here.
Converting man page into text files:
# man passwd | col -b > passwd.txt
This will create a passwd.txt file which can be printed easily.
Taking Printout of text file:
You can take the printout of the text file by using any of the following commands:
# cat passwd.txt | lpr
OR
# lpr passwd.txt
OR
# lpr passwd.txt
One liner command:
You can also use this one liner command to take the printout of the man page:
# man passwd | col -b | lpr
You can also print “info” pages with the same procedure:
# info passwd | col -b | lpr
Create PDF:
If you would like to create a pdf of man pages then that can also be done by this simple command:
# man -t passwd | ps2pdf - passwd.pdf
Related Posts
No related posts.
[...] How To : Print Linux man & info Pages [...]
[...] How To : Print Linux man & info Pages [...]
Is there a way to also convert info pages into text or PDF files? I tried to use the PDF creation command above for info files, by replacing “man -t” with “info”, but this did not yield a populated PDF file (it created an empty file, instead).
Thanks for your help!