You are not logged in.

#1 2010-08-27 15:01:57

lagagnon
Member
From: an Island in the Pacific...
Registered: 2009-12-10
Posts: 1,087
Website

[Solved] Reformatting man page print from command line?

I am wanting to print a few man pages direct from the command line. I used this command:

man command | lpr -P Printer

, which works, but the default font and characters per line produces output that straggles lines. I have looked at "man fmt" but there is no option to change font size, only max. line width. The problem is changing line width only partly solves the problem as man pages have linefeeds.

Any ideas on how to get a decent printed copy of man pages from the command line would be appreciated.

Last edited by lagagnon (2010-08-28 00:19:40)


Philosophy is looking for a black cat in a dark room. Metaphysics is looking for a black cat in a dark room that isn't there. Religion is looking for a black cat in a dark room that isn't there and shouting "I found it!". Science is looking for a black cat in a dark room with a flashlight.

Offline

#2 2010-08-27 15:15:18

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [Solved] Reformatting man page print from command line?

This is actually covered in man's man page.

man -t alias | lpr -pPrinter

where alias is the page you want to print.

Offline

#3 2010-08-27 17:37:05

lagagnon
Member
From: an Island in the Pacific...
Registered: 2009-12-10
Posts: 1,087
Website

Re: [Solved] Reformatting man page print from command line?

DOH! Maybe I should learn to read the man pages a bit more carefully - thanks falconindy!


Philosophy is looking for a black cat in a dark room. Metaphysics is looking for a black cat in a dark room that isn't there. Religion is looking for a black cat in a dark room that isn't there and shouting "I found it!". Science is looking for a black cat in a dark room with a flashlight.

Offline

#4 2010-08-27 18:08:23

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: [Solved] Reformatting man page print from command line?

please mark as solved


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#5 2010-08-27 18:12:47

Doehni
Member
From: Germany
Registered: 2007-05-19
Posts: 175

Re: [Solved] Reformatting man page print from command line?

lagagnon wrote:

DOH! Maybe I should learn to read the man pages a bit more carefully - thanks falconindy!

Just memorize them after printing... tongue

Offline

#6 2010-08-28 04:51:22

quigybo
Member
Registered: 2009-01-15
Posts: 223

Re: [Solved] Reformatting man page print from command line?

I love the -t option, I actually have it as a function to view man pages as pdf, it is really handy on longer manuals as the output of -t is much nicer than reading from a terminal.

manpdf () {man -t $1 | ps2pdf - /tmp/manpdf_$1.pdf && xdg-open /tmp/manpdf_$1.pdf ;}

Offline

Board footer

Powered by FluxBB