I want to get man pages to stout. However, I have not managed a way to do that.
Pseudo-code about what I am trying to achieve
man man | lpr
How can you print a manual, such that you see first how many pages is going to be printed?
|
I want to get man pages to stout. However, I have not managed a way to do that. Pseudo-code about what I am trying to achieve
How can you print a manual, such that you see first how many pages is going to be printed?
| ||||
|
feedback
|
This tells man to format the output as a postscript file which can be piped directly to a printer. See the man page for further -T (troff) formatting options. To preview the output pipe it to a file and view it with gv or okular.
| |||||||||||
feedback
|
|
man ls | col -b | lpr -P my_printer This prints the man page for "ls" formats it using "col" and then prints on the printer named "my_printer" The formatting isn't required, but gets rid of special characters making it easier to read. | |||
|
feedback
|
|
Newer versions of man (at least my version on openSuSE 11 :) ) automatically detect if output is a terminal or a pipe. If you want non-formatted man pages to stdout, try:
For manpages going to the printer, I like:
| ||||
|
feedback
|
|
Answer to # of pages question above(need 50 rep to add comments):
The default # of lines per page is 60, so if you aren't changing that, then just divide by 60 and round up. I forget how to make awk treat FP as INT so that it rounds for you. | |||||
feedback
|