SUNWdoc
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.
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.
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.
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
- sections specified on the command line with the -s option
- sections embedded in the MANPATH environment variable
- sections specified in the man.cf file for each directory specified in the MANPATH
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:
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.
Manual pages are troff(1) or nroff(1) source files prepared with the -man macro package. Please refer to man(5) for more information.
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:
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.
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.
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)
.
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.