man Pages Tutorial


For more details, check out the Online Help section of the UNIX at D0 page.

Using the man pages:

man is the UNIX on-line help. It's not as straightforward as HELP on VMS because you must know the command name that you want help with. For example, let's say I've seen the command 'grep' in various shell scripts. I'm not exactly sure what 'grep' does, so I want to look it up in the man pages:
	% man grep

GREP(1)                                                                GREP(1)

NAME
     grep - search a file for a pattern

SYNOPSIS
     grep [options] limited regular expression [file . . .]

DESCRIPTION
     grep searches files for a pattern and prints all lines that contain that
     pattern.  grep uses limited regular expressions (expressions that have
     string values that use a subset of the possible alphanumeric and special
     characters) like those used with ed(1) to match the patterns.  It uses a
     compact non-deterministic algorithm.
: (Striking the space-bar here will scroll through the rest of the 
documentation.  You can also type 'q' to exit out of man.)


Searching the man pages:


You can search the man pages for a pattern. Suppose I want to find all the instances of "search" under grep. At the command prompt (:), I type "/search". I can continue to find instances of "search" by simply typing "/" at the command prompt.
	% man grep
GREP(1)                                                                GREP(1)

NAME
     grep - search a file for a pattern

SYNOPSIS
     grep [options] limited regular expression [file . . .]

DESCRIPTION
     grep searches files for a pattern and prints all lines that contain that
     pattern.  grep uses limited regular expressions (expressions that have
     string values that use a subset of the possible alphanumeric and special
     characters) like those used with ed(1) to match the patterns.  It uses a
     compact non-deterministic algorithm.
/search
     grep - search a file for a pattern
     ...

Printing the man pages:

You can also print a man page by first converting it to PostScript format and then printing. You can do this in one line using the pipe "|" feature.
	% man grep | a2ps -m | flpr -q d0tce_post
	[Total: 1 page on 1 sheet]
	<stdin> data sent to d0gs01.fnal.gov's d0tce_post
	print request for above sent to d0gs01.fnal.gov

Tutorials | E-Mailing | Editing | Compiling

D0 HOME | D0 At Work | UNIX at D0
Last updated 11 June 1997
J. Perkins