Click to See Complete Forum and Search --> : printing man pages?


stavefan
10-18-2001, 02:15 PM
Hi all,

I would like to print out a man page, but I have no idea how to do so.

If anyone knows how, I would love to know

thanks
stavefan

godot
10-18-2001, 02:20 PM
how about you pipe it into a file?

man xxxx >> manpageforxxxx.txt

then print it

Syngin
10-18-2001, 02:27 PM
Hehe seems like a newbie-ish question but that helps me out quite a bit too.

Thanks. :)

godot
10-18-2001, 02:58 PM
well, | and >> commands aren't very newbie-oriented and it took me a long time to figure out just how powerful they really are. I decided I needed to print out the iptables man page a while ago and went about trying to figure out how. Came up with that.

stavefan
10-18-2001, 03:31 PM
unfortunately that does not work, as the resulting text file is illegible due to the formatting within the man document

i've tried redirecting the output straight to a text file as suggested above, with no luck and i've also tried to output the man page by piping it through every command that i could think of( cat, head, tail, etc..) and redirecting it to the text file, but everything that I've tried comes out with something that is not close to just a text file that I could then print out...

Hmmm...guess i gotta keep trying

Strogian
10-18-2001, 03:37 PM
Have you checked the man page of man? Maybe there's a way to do it in there. :)

godot
10-18-2001, 03:41 PM
the output is not readable by notepad if that's how you're opening it. linux can read the file just fine, whether it's cat, pico, or whatever. if you must print from windows open it up in MS Word and pick the correct file format (i forget which it is but it gives a preview of the file to help you choose).

dud
10-18-2001, 03:48 PM
This is how I do. (And it WORKS!)

man manpage | col -bx >file.txt

"col -bx" takes out the weird characters in the man page...

stavefan
10-18-2001, 03:53 PM
dud's right...Strogian's got the right answer also...there is an example at the very end of the man page for man.....

Cool!!! i just learned something new!

Thanks for all the input
stavefan

Time to read the man page!

stiles
10-18-2001, 09:58 PM
you don't need the -x argument to col. It doesn't hurt anything though.