Previous Section  < Day Day Up >  Next Section

Recipe 1.10. Printing Selected man or info Pages

1.10.1 Problem

You would like to print selected man and info pages, because most man and info documents are quite long. For example, man bash consumes 33 printed pages. How can you print pages selectively?

1.10.2 Solution

Export the man or info page to a plain text file, using the col command. Then you can easily select the pages to print. To do this with man bash or info bash use:

$ man bash | col -b > bash.txt

$ info bash | col -b > bash.txt

1.10.3 Discussion

If you just type man bash > bash.txt, the results will be unpleasant. col -b cleans things up considerably by removing reverse line feeds, or backspaces. This is especially suited for converting man pages to plain text, because man pages are full of reverse line feeds, which then appear in text files as either empty boxes or repeated characters.

1.10.4 See Also

  • col(1)

    Previous Section  < Day Day Up >  Next Section