-
How to print a man page from the command line in Linux
Posted on September 10th, 2008 No commentsMan page also called a MANual is an electronic document found commonly in all Linux and Unix operating systems. Each command will have its own
manpage which explains how to use that particular command.
For example, to view the man page of the Linux commandls, fire up a terminal and enter the following :$ man ls
Print a man page
You can print a man page from the command line as follows :
$ man -t <command> | lpr
-tindicates that ‘man‘ must format the manual to be used for the printer. The output of ‘man -t‘ is in a printing language called postscript.So for example, to print the man page of
catcommand, we can do the following :$ man -t cat | lpr
By using the command
lprafter the pipe, you are sending the output to the printer. But before you send the entire manual to the printer, it is always prudent to check the number of pages that will be send to the printer. This is done by using thewccommand as follows :$ man cat | wc -l 71
71 lines above translates to less than a page since 80 lines fit on an A4 page. If a manual has lots more lines, dividing the lines by 80 will give you an approximate idea of the number of pages that will be used by the printer to print the manual.
Related Posts
- Print files with line numbers for each line in Linux
- How to find large files in Linux using command line
- pwd – Linux Command to Print Working Directory
- Print huge Posters using your desktop printer
- id – Print user identity in Linux










