mind the explanatory gap

many a slip ‘twixt mind and lip…

mind the explanatory gap RSS Feed

Converting man pages to text…

I've beeing using groff to nicely format man pages to plain text like so:

groff -mandoc -Tascii  /usr/share/man/man1/ps.1 > man_ps.txt

but the problem is that you need to find the actual man page file, which adds another step to the process. This tip landed in my inbox the other day from the Unix Guru Universe Hot Tip of the Day list.

To convert a man page to text, simply do:

man ps | col -b > man_ps.txt

Much easier than messing around with groff and the mandoc options.

groff is still more useful for doing stuff like exporting to straight html like:

groff -mandoc -Thtml  /usr/share/man/man1/ps.1

Leave a Reply