man - find and display reference manual pages
man [-] [-adFlrt] [-M path] [-T macro-package] [-s section] name...
man [-M path] -k keyword...
man [-M path] -f file...
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.
Reference Manual pages are marked up with either nroff (see nroff(1)) or SGML (Standard Generalized Markup Language) tags (see sgml(5)). The man command recognizes the type of markup and processes the file accordingly. The various source files are kept in separate directories depending on the type of markup.
The online Reference Manual page directories are conventionally located in /usr/share/man. The nroff sources are located in the /usr/share/man/man* directories. The SGML sources are located in the /usr/share/man/sman* directories. Each directory corresponds to a section of the manual. Since these directories are optionally installed, they might not reside on your host. You might 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 stores 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. man 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.
The following options are supported:
-a
-d
-f file ...
-F
-k keyword ...
-l
-M path
-r
-s section ...
-t
-T macro-package
The following operand is supported:
name
The usage of man is described below:
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, for example, "9", does not act as an abbreviation for the subsections of that name, such as "9e", "9f", or "9s". That is, each subsection must be searched separately by man -s. 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.
In the absence of MANPATH, man constructs its search path based upon the PATH environment variable, primarily by substituting man for the last component of the PATH element. Special provisions are added to account for unique characteristics of directories such as /sbin, /usr/ucb, /usr/xpg4/bin, and others. If the file argument contains a / character, the dirname portion of the argument is used in place of PATH elements to construct the search path.
Within the manual page directories, man confines its search to the sections specified in the following order:
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.
Manual pages are marked up in nroff(1) or sgml(5). Nroff manual pages are processed by nroff(1) or troff(1) with the -man macro package. Please refer to man(5) for information on macro usage. SGML---tagged manual pages are processed by an SGML parser and passed to the formatter.
When formatting an nroff 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
r
t
v
If eqn or neqn is invoked, it automatically reads the file /usr/pub/eqnchar (see eqnchar(5)). If nroff(1) is invoked, col(1) is automatically used.
If the first line of the nroff 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.
Manual pages are identified as being marked up in SGML by the presence of the string <!DOCTYPE. If the file also contains the string SHADOW_PAGE, the file refers to another manual page for the content. The reference is made with a file entity reference to the manual page that contains the text. This is similar to the .so mechanism used in the nroff formatted man pages.
See environ(5) for descriptions of the following environment variables that affect the execution of man: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES, and NLSPATH.
MANPATH
PAGER
TCAT
TROFF
Example 1 Creating a PostScript Version of a man page
The following example creates the pipe(2) man page in postscript for csh, tcsh, ksh and sh users:
% env TCAT=/usr/lib/lp/postscript/dpost man -t -s 2 pipe > pipe.ps
This is an alternative to using man -t, which sends the man page to the default printer, if the user wants a postscript file version of the man page.
Example 2 Creating a Text Version of a man page
The following example creates the pipe(2) man page in ascii text:
man pipe.2 | col -x -b > pipe.text
This is an alternative to using man -t, which sends the man page to the default printer, if the user wants a text file version of the man page.
The following exit values are returned:
0
>0
/usr/share/man
/usr/share/man/man?/*
/usr/share/man/sman?/*
/usr/share/man/cat?/*
/usr/share/man/fmt?/*
/usr/share/man/windex
/usr/share/lib/tmac/an
/usr/share/lib/sgml/locale/C/dtd/*
/usr/share/lib/sgml/locale/C/solbook/*
/usr/share/lib/pub/eqnchar
man.cf
See attributes(5) for descriptions of the following attributes:
|
apropos(1), cat(1), col(1), dpost(1), eqn(1), more(1), nroff(1), refer(1), tbl(1), troff(1), vgrind(1), whatis(1), catman(1M), attributes(5), environ(5), eqnchar(5), man(5), sgml(5), standards(5)
The -f and -k options use the windex database, which is created by catman(1M).
The man command is CSI-capable. However, some utilities invoked by the man command, namely, troff, eqn, neqn, refer, tbl, and vgrind, are not verified to be CSI-capable. Because of this, the man command with the -t option can not handle non-EUC data. Also, using the man command to display man pages that require special processing through eqn, neqn, refer, tbl, or vgrind can not be CSI-capable.
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. Control-q clears a terminal that gets confused by eqn(1) output.
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |