Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
up vote 11 down vote accepted

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
share|improve this answer

Man pages are usually troff pre-processed files, and you can get to the plain text with,

groff -t -e -mandoc -Tascii manpage.1 | col -bx > manpage.txt

groff is a wrapper for troff.

More information here.

You might need to use gzip to uncompress the man page files first, and you'll still have plenty of formatting information in the output.

share|improve this answer
+1 for talking about groff/troff and the formatting of man pages – lgeorget Jun 25 '14 at 11:26

Just use the man command - you can pipe the output into other things just as you can with cat for a file.

share|improve this answer
I like the simplicity. – Joel Sjögren Apr 28 '13 at 12:31

To get an ASCII man page file, without the annoying backspace/underscore attempts at underlining, and weird sequences to do bolding:

man ksh | col -b > ksh.txt
share|improve this answer

If you just want to cat a manpage, you can simply pipe it to cat:

man ls | cat

If you want to dump its content to a file:

man ls > ls_manpage_dump.txt
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.