Cleaning output from man pages

As you probably know, man pages contain escape characters used for formatting the text.. This escape characters are very annoying if you want to get a printed copy or want to see the man pages in your favorite editor.

This small trick will allow you to dump the man pages to a text file so you could print it or edit it with your editor.

man ls | col -b > ls.txt

This will send the man ls output to the col filter which will out reverse line feeds, replace white space characters etc. Finally the output goes to the file ls.txt.

References:

Leave a Reply

You must be logged in to post a comment.