Saturday, July 11, 2009

Send a Manpage to a Text File

There are a few different ways to convert a Linux manpage to a text file. Using the ls command as an example, you could save the ls manpage as a text file by using one of the following commands:

$ man ls > ls.txt

or

$ man ls&> ls.txt

Those will give you the text file ls.txt in your current directory.

Those might leave you with some weird formatting characters in your output, so here are a couple of other commands that I'd use instead:

$ man ls | col -bx > ls.txt

or

$ man ls | col -b > ls.txt

No comments: