NAME
man, apropos,
whatis —
display online manual documentation
pages
SYNOPSIS
man |
[-adho] [-t |
-w] [-M
manpath] [-P
pager] [-S
mansect] [-m
arch[:machine]]
[-p [eprtv]]
[mansect] page ... |
man |
-f [-d]
[-M manpath]
[-P pager]
[-S mansect]
keyword ... |
whatis |
[-d] [-s
mansect] keyword ... |
man |
-k [-d]
[-M manpath]
[-P pager]
[-S mansect]
keyword ... |
apropos |
[-d] [-s
mansect] keyword ... |
DESCRIPTION
The man utility finds and displays online
manual documentation pages. If mansect is provided,
man restricts the search to the specific section of
the manual.
The sections of the manual are:
- General Commands Manual
- System Calls Manual
- Library Functions Manual
- Kernel Interfaces Manual
- File Formats Manual
- Games Manual
- Miscellaneous Information Manual
- System Manager's Manual
- Kernel Developer's Manual
Options that man understands:
-Mmanpath- Forces a specific colon separated manual path instead of the default
search path. See manpath(1). Overrides the
MANPATHenvironment variable. -Ppager- Use specified pager. Defaults to “
less -sR” if color support is enabled, or “less -s”. Overrides theMANPAGERenvironment variable, which in turn overrides thePAGERenvironment variable. -Smansect- Restricts manual sections searched to the specified colon delimited list.
Defaults to
“
1:8:2:3:3lua:n:4:5:6:7:9:l”. Overrides theMANSECTenvironment variable. -a- Display all manual pages instead of just the first found for each page argument.
-d- Print extra debugging information. Repeat for increased verbosity. Does not display the manual page.
-f- Emulate whatis(1). Note that only a subset of options will have any effect
when
manis invoked in this mode. See the below description ofwhatisoptions for details. -h- Display short help message and exit.
-k- Emulate apropos(1). Note that only a subset of options will have any effect
when
manis invoked in this mode. See the below description ofaproposoptions for details. -march[:machine]- Override the default architecture and machine settings allowing lookup of other platform specific manual pages. This option is accepted, but not implemented, on macOS.
-o- Force use of non-localized manual pages. See
IMPLEMENTATION NOTES for
how locale specific searches work. Overrides the
LC_ALL,LC_CTYPE, andLANGenvironment variables. -p[eprtv]- Use the list of given preprocessors before running
nroff(1)
or troff(1). Valid preprocessors arguments:
e- eqn(1)
p- pic(1)
r- refer(1)
t- tbl(1)
v- vgrind(1)
Overrides the
MANROFFSEQenvironment variable. -t- Send manual page source through troff(1) allowing transformation of the manual pages to other formats.
-w- Display the location of the manual page instead of the contents of the manual page.
Options that apropos and
whatis understand:
-d- Same as the
-doption forman. -s- Same as the
-Soption forman.
When man is operated in
apropos or whatis emulation
mode, only a subset of its options will be honored. Specifically,
-d, -M,
-P, and -S have equivalent
functionality in the apropos and
whatis implementation provided. The
MANPATH, MANSECT, and
MANPAGER environment variables will similarly be
honored.
IMPLEMENTATION NOTES
Locale Specific Searches
The man utility supports manual pages in
different locales. The search behavior is dictated by the first of three
environment variables with a nonempty string:
LC_ALL, LC_CTYPE, or
LANG. If set, man will
search for locale specific manual pages using the following logic:
- lang_country.charset
- lang.charset
en.charset
For example, if LC_ALL is set to
“ja_JP.eucJP”,
man will search the following paths when considering
section 1 manual pages in /usr/share/man:
- /usr/share/man/ja_JP.eucJP/man1
- /usr/share/man/ja.eucJP/man1
- /usr/share/man/en.eucJP/man1
- /usr/share/man/man1
Displaying Specific Manual Files
The man utility also supports displaying a
specific manual page if passed a path to the file as long as it contains a
‘/’ character.
ENVIRONMENT
The following environment variables affect the execution of
man:
LC_ALL,LC_CTYPE,LANG- Used to find locale specific manual pages. Valid values can be found by
running the locale(1) command. See
IMPLEMENTATION NOTES for
details. Influenced by the
-ooption. MACHINE_ARCH,MACHINE- Used to find platform specific manual pages. If unset, the output of
“
sysctl hw.machine_arch” and “sysctl hw.machine” is used respectively. See IMPLEMENTATION NOTES for details. Corresponds to the-moption. MANPATH- The standard search path used by
man(1) may be
changed by specifying a path in the
MANPATHenvironment variable. Invalid paths, or paths without manual databases, are ignored. Overridden by-M. IfMANPATHbegins 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. MANROFFSEQ- Used to determine the preprocessors for the manual source before running
nroff(1)
or troff(1). If unset, defaults to
tbl(1).
Corresponds to the
-poption. MANSECT- Restricts manual sections searched to the specified colon delimited list.
Corresponds to the
-Soption. MANWIDTH- If set to a numeric value, used as the width manpages should be displayed.
Otherwise, if set to a special value
“
tty”, and output is to a terminal, the pages may be displayed over the whole width of the screen. MANCOLOR- If set, enables color support.
MANPAGER- Program used to display files.
If unset, and color support is enabled, “
less -sR” is used.If unset, and color support is disabled, then
PAGERis used. If that has no value either, “less -s” is used.
FILES
- /etc/man.conf
- System configuration file.
- /usr/local/etc/man.d/*.conf
- Local configuration files.
EXIT STATUS
The man utility exits 0 on success,
and >0 if an error occurs.
EXAMPLES
Show the manual page for stat(2):
$ man 2 stat
Show all manual pages for
‘stat’.
$ man -a stat
List manual pages which match the regular expression either in the title or in the body:
$ man -k '\<copy\>.*archive'
Show the manual page for ls(1) and use cat(1) as pager:
$ man -P cat ls
Show the location of the ls(1) manual page:
$ man -w ls
SEE ALSO
apropos(1), intro(1), mandoc(1), manpath(1), whatis(1), intro(2), intro(3), intro(3lua), intro(4), intro(5), man.conf(5), intro(6), intro(7), mdoc(7), intro(8), intro(9)