Man Pages – How to Dump a Man Page

man

How can I 'cat' a man page like I would 'cat' a file to get just a dump of the contents?

Best Answer

First of all, the man files are usually just gziped text files somewhere in your file system. Since your milage will vary finding them and you probably wanted the processed and formatted version that man gives you instead of the source, you can just dump them with the man tool. By looking at man man, I see that you can change the program used to view man pages with the -P flag like this:

man -P cat command_name

It's also worth nothing that man automatically detects when you pipe it's output instead of viewing it on the screen, so if you are going to process it with something else you can skip straight to that step like so:

man command_name | grep search_string

or to dump TO a file:

man command_name > formatted_man_page.txt
Related Question