previous | start | next

Unix Online Manual: Example 3

Using the "less" command to view a page at a time is convenient for one time quick checks. But you may want to save the output in a file to examine inside an editor (emacs) where you can search, and use all other editor commands.

You can redirect the output of any program including man to a file instead of to the screen.

As a first attempt, redirect the man page output for od to a file named, say, od.txt:

$ man od > od.txt    
     

Now you can open this file in emacs.

$ emacs od.txt

Unfortunately, here's what you might see in emacs:

 N^HN^HN^HNA^HA^HA^HAM^HM^HM^HME^HE^HE^HE
      od, xd - octal and hexadecimal dump
      ...
        
     

All the ^H characters are not printed for screen output; they are interpreted as signal to the display device to backspace and then the character is printed again for screen emphasis.

When output is redirected to a file, we would like to get rid of these backspace control characters.

A Unix utility, col with the -b option can filter out these characters. Use a pipe and then :

$ man od | col -b > od.txt
     


previous | start | next