NAME
man —
display manual pages
SYNOPSIS
man |
[-acfhklw] [-C
file] [-M
path] [-m
path] [-S
subsection] [[-s]
section] name ... |
DESCRIPTION
The man utility displays the manual pages
entitled name. Pages may be selected according to a
specific category (section) or machine architecture
(subsection).
The options are as follows:
-a- Display all matching manual pages. Normally, only the first page found is displayed.
-Cfile- Use the specified file instead of the default configuration file. This permits users to configure their own manual environment. See man.conf(5) for a description of the contents of this file.
-c- Copy the manual page to the standard output instead of using more(1) to paginate it. This is done by default if the standard output is not a terminal device.
-f- A synonym for whatis(1). It searches for name in manual page names and displays the header lines from all matching pages. The search is case insensitive and matches whole words only.
-h- Display only the SYNOPSIS lines of the requested manual pages. Implies
-aand-c. -k- A synonym for apropos(1). Instead of name, an expression can be provided using the syntax described in the apropos(1) manual. By default, it displays the header lines of all matching pages.
-l- A synonym for
mandoc(1)
-a. The name arguments are interpreted as filenames. No search is done and file, path, section, subsection, and-ware ignored. -Mpath- Override the list of standard directories which
mansearches for manual pages. The supplied path must be a colon (‘:’) separated list of directories. This search path may also be set using the environment variableMANPATH. -mpath- Augment the list of standard directories which
mansearches for manual pages. The supplied path must be a colon (‘:’) separated list of directories. These directories will be searched before the standard directories or the directories specified using the-Moption or theMANPATHenvironment variable. -Ssubsection- Only show pages for the specified
machine(1) architecture. subsection is case
insensitive.
By default manual pages for all architectures are installed. Therefore this option can be used to view pages for one architecture whilst using another.
This option overrides the
MACHINEenvironment variable. - [
-s] section - Only select manuals from the specified section. The
currently available sections are:
- 1
- General commands (tools and utilities).
- 2
- System calls and error numbers.
- 3
- Library functions.
- 3p
- perl(1) programmer's reference guide.
- 4
- Device drivers.
- 5
- File formats.
- 6
- Games.
- 7
- Miscellaneous information.
- 8
- System maintenance and operation commands.
- 9
- Kernel internals.
If not specified and a match is found in more than one section, the first match is selected from the following list: 1, 8, 6, 2, 3, 5, 7, 4, 9, 3p.
-w- List the pathnames of all matching manual pages instead of displaying any of them.
The options -IKOTW are also supported and
are documented in
mandoc(1). The options -fkl are mutually
exclusive and override each other.
Guidelines for writing man pages can be found in mdoc(7).
If both a formatted and an unformatted version of the same manual page, for example cat1/foo.0 and man1/foo.1, exist in the same directory, only the unformatted version is used.
ENVIRONMENT
MACHINE- As some manual pages are intended only for specific architectures,
mansearches any subdirectories, with the same name as the current architecture, in every directory which it searches. Machine specific areas are checked before general areas. The current machine type may be overridden by setting the environment variableMACHINEto the name of a specific architecture, or with the-Soption.MACHINEis case insensitive. MANPAGER- Any non-empty value of the environment variable
MANPAGERis used instead of the standard pagination program, more(1). If less(1) is used, the interactive:tcommand can be used to go to the definitions of various terms, for example command line options, command modifiers, internal commands, environment variables, function names, preprocessor macros, errno(2) values, and some other emphasized words. Some terms may have defining text at more than one place. In that case, the less(1) interactive commandstandTcan be used to move to the next and to the previous place providing information about the term last searched for with:t. MANPATH- The standard search path used by
manmay be changed by specifying a path in theMANPATHenvironment variable. The format of the path is a colon (‘:’) separated list of directories. Invalid paths, or paths without manual databases, are ignored. Overridden by-M, ignored if-lis specified.If
MANPATHbegins with a colon, it is appended to the default list; if it ends with a colon, it is prepended to the default list; or if it contains two adjacent colons, the standard search path is inserted between the colons. If none of these conditions are met, it overrides the standard search path. PAGER- Specifies the pagination program to use when
MANPAGERis not defined. If neither PAGER nor MANPAGER is defined, more(1)-sis used. Only used if-aor-lis specified.
FILES
- /etc/man.conf
- default man configuration file
EXIT STATUS
The man utility exits 0 on success,
and >0 if an error occurs. See
mandoc(1) for details.
SEE ALSO
apropos(1), intro(1), whereis(1), intro(2), intro(3), intro(4), intro(5), man.conf(5), intro(6), intro(7), mdoc(7), intro(8), intro(9)
STANDARDS
The man utility is compliant with the
IEEE Std 1003.1-2008 (“POSIX.1”)
specification.
The flags [-aCcfhIKlMmOSsTWw], as well as
the environment variables MACHINE,
MANPAGER, and MANPATH, are
extensions to that specification.
HISTORY
A man command first appeared in
Version 3 AT&T UNIX.
The -w option first appeared in
Version 7 AT&T UNIX;
-f and -k in
4BSD; -M in
4.3BSD; -a in
4.3BSD-Tahoe; -c and
-m in 4.3BSD-Reno;
-h in 4.3BSD-Net/2;
-C in NetBSD 1.0;
-s and -S in
OpenBSD 2.3; and -I,
-K, -l,
-O, and -W in
OpenBSD 5.7. The -T option
first appeared in AT&T System III UNIX
and was also added in OpenBSD 5.7.