[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    man(1) manual page Table of Contents

Name

man - find and display reference manual pages

Synopsis

man [ - ] [ -adFlrt ] [ -M path ] [ -T macro-package ] [-s section ] name ...
man [ -M path ] -k keyword ...
man [ -M path ] -f file ...

Availability

SUNWdoc

Description

The man command displays information from the reference manuals. It displays complete manual pages that you select by name, or one-line summaries selected either by keyword (-k), or by the name of an associated file (-f). If no manual page is located, man prints an error message.

Location of Manual Pages

The reference page sources are typically located in the /usr/share/man/man* or /usr/man/man* directories, with each directory corresponding to a section of the manual. Since these directories are optionally installed, they may not reside on your host; you may have to mount /usr/share/man from a host on which they do reside. If there are preformatted, up-to-date versions in the corresponding cat* or fmt* directories, man simply displays or prints those versions. If the preformatted version of interest is out of date or missing, man reformats it prior to display and will store the preformatted version if cat? or fmt? is writable. The windex database is not updated. See catman(1M) . If directories for the preformatted versions are not provided, man reformats a page whenever it is requested; it uses a temporary file to store the formatted text during display.

If the standard output is not a terminal, or if the ‘-’ flag is given, man pipes its output through cat(1) ; otherwise, man pipes its output through more(1) to handle paging and underlining on the screen.

Options

The following options are supported:
-a
Show all manual pages matching name within the MANPATH search path. Manual pages are displayed in the order found.
-d
Debug. Displays what a section-specifier evaluates to, method used for searching, and paths searched by man.
-f file...
man attempts to locate manual pages related to any of the given files. It strips the leading path name components from each file, and then prints one-line summaries containing the resulting basename or names. This option also uses the windex database.
-F
Force man to search all directories specified by MANPATH or the man.cf file, rather than using the windex lookup database. This is useful if the database is not up to date. If the windex database does not exist, this option is assumed.
-k keyword ...
Print out one-line summaries from the windex database (table of contents) that contain any of the given keywords. The windex database is created using catman(1M) .
-l
List all manual pages found matching name within the search path.
-M path
Specify an alternate search path for manual pages. path is a colon-separated list of directories that contain manual page directory subtrees. For example, if path is /usr/share/man:/usr/local/man, man searches for name in the standard location, and then /usr/local/man. When used with the -k or -f options, the -M option must appear first. Each directory in the path is assumed to contain subdirectories of the form man*, one for each section. This option overrides the MANPATH environment variable.
-r
Reformat the manual page, but do not display it. This replaces the man - -t name combination.
-s section ...
Specify sections of the manual for man to search. The directories searched for name is limited to those specified by section. section can be a digit (perhaps followed by one or more letters), a word (for example: local, new, old, public), or a letter. To specify multiple sections, separate each section with a comma. This option overrides the MANPATH environment variable and the man.cf file. See Search Paths below for an explanation of how man conducts its search.
-t
man arranges for the specified manual pages to be troffed to a suitable raster output device (see troff(1) . If both the - and -t flags are given, man updates the troffed versions of each named name (if necessary), but does not display them.
-T macro-package
Format manual pages using macro-package rather than the standard -man macros defined in /usr/share/lib/tmac/an. See Search Path under USAGE for a complete explanation of the default search path order.

Operands

The following operand is supported:
name
A keyword or the name of a standard utility.

Usage

Manual Page Sections

Entries in the reference manuals are organized into sections. A section name consists of a major section name, typically a single digit, optionally followed by a subsection name, typically one or more letters. An unadorned major section name acts as an abbreviation for the section of the same name along with all of its subsections. Each section contains descriptions apropos to a particular reference category, with subsections refining these distinctions. See the intro manual pages for an explanation of the classification used in this release.

Search Path

Before searching for a given name, man constructs a list of candidate directories and sections. man searches for name in the directories specified by the MANPATH environment variable. If this variable is not set, /usr/share/man is searched by default.

Within the manual page directories, man confines its search to the sections specified in the following order:

environment variable

If none of the above exist, man searches each directory in the manual page path, and displays the first matching manual page found.

The man.cf file has the following format:

MANSECTS=section[,section]...

Lines beginning with ‘#’ and blank lines are considered comments, and are ignored. Each directory specified in MANPATH can contain a manual page configuration file, specifying the default search order for that directory.

Formatting Manual Pages

Manual pages are troff(1) or nroff(1) source files prepared with the -man macro package. Please refer to man(5) for more information.

Preprocessing Manual Pages

When formatting a manual page, man examines the first line to determine whether it requires special processing. If the first line is a string of the form:

’\" X

where X is separated from the ‘"’ by a single SPACE and consists of any combination of characters in the following list, man pipes its input to troff(1) or nroff(1) through the corresponding preprocessors.

e
eqn(1) , or neqn for nroff
r
refer(1)
t
tbl(1)
v
vgrind(1)

If eqn or neqn is invoked, it will automatically read the file /usr/pub/eqnchar (see eqnchar(5) ). If nroff(1) is invoked, col(1) is automatically used.

Referring to Other Manual Pages

If the first line of the manual page is a reference to another manual page entry fitting the pattern:

.so man*/ sourcefile

man processes the indicated file in place of the current one. The reference must be expressed as a path name relative to the root of the manual page directory subtree.

When the second or any subsequent line starts with .so, man ignores it; troff(1) or nroff(1) processes the request in the usual manner.

Environment

See environ(5) for descriptions of the following environment variables that affect the execution of man: LC_CTYPE , LC_MESSAGES , and NLSPATH .
MANPATH
A colon-separated list of directories; each directory can be followed by a comma-separated list of sections. If set, its value overrides /usr/share/man as the default directory search path, and the man.cf file as the default section search path. The -M and -s flags, in turn, override these values.)
PAGER
A program to use for interactively delivering man’s output to the screen. If not set, ‘more -s’ (see more(1) ) is used.
TCAT
The name of the program to use to display troffed manual pages.
TROFF
The name of the formatter to use when the -t flag is given. If not set, troff(1) is used.

Exit Status

The following exit values are returned:
  1. Successful completion.
    >0
    An error occurred.

    Files

    /usr/share/man
    root of the standard manual page directory subtree
    /usr/share/man/man?/*
    unformatted manual entries
    /usr/share/man/cat?/*
    nroffed manual entries
    /usr/share/man/fmt?/*
    troffed manual entries
    /usr/share/man/windex
    table of contents and keyword database
    /usr/share/lib/tmac/an
    standard -man macro package
    /usr/share/lib/pub/eqnchar
    standard definitions for eqn and neqn
    man.cf
    default search order by section

    See Also

    apropos(1) , cat(1) , col(1) , eqn(1) , more(1) , nroff(1) , refer(1) , tbl(1) , troff(1) , vgrind(1) , whatis(1) , catman(1M) , environ(5) , eqnchar(5) , man(5)

    Notes

    Because troff is not 8-bit clean, man has not been made 8-bit clean.

    The -f and -k options use the /usr/share/man/windex database, which is created by catman(1M) .

    Bugs

    The manual is supposed to be reproducible either on a phototypesetter or on an ASCII terminal. However, on a terminal some information (indicated by font changes, for instance) is lost.

    Some dumb terminals cannot process the vertical motions produced by the e (see eqn(1) ) preprocessing flag. To prevent garbled output on these terminals, when you use e also use t, to invoke col(1) implicitly. This workaround has the disadvantage of eliminating superscripts and subscripts -- even on those terminals that can display them. CTRL-Q will clear a terminal that gets confused by eqn(1) output.


    Table of Contents