— search manual page
whatis utilities query manual page databases
makewhatis(8), evaluating expression
for each file in each database. By default, they display the names, section
numbers, and description lines of all matching manuals.
apropos searches for
makewhatis(8) databases in the default paths stipulated by
man(1) and uses case-insensitive substring matching (the
= operator) over manual
names and descriptions (the
macro keys). Multiple terms imply pairwise
whatis is a synonym for
The options are as follows:
- Instead of showing only the title lines, show the complete manual pages,
just like man(1)
-awould. If the standard output is a terminal device and
-cis not specified, use more(1) to paginate them. In
-amode, the options
-IKOTWdescribed in the mandoc(1) manual are also available.
- Specify an alternative configuration file in man.conf(5) format.
-amode, copy the formatted manual pages to the standard output without using more(1) to paginate them.
- Search for all words in expression in manual page
names only. The search is case insensitive and matches whole words only.
In this mode, macro keys, comparison operators, and logical operators are
not available. This overrides any earlier
- Instead of showing the title lines, show the SYNOPSIS sections, just like
- Support the full expression syntax. This overrides
-loptions. It is the default for
- An alias for
-a. This overrides any earlier
- Use the colon-separated path instead of the default list of paths searched for makewhatis(8) databases. Invalid paths, or paths without manual databases, are ignored.
- Prepend the colon-separated paths to the list of paths searched for makewhatis(8) databases. Invalid paths, or paths without manual databases, are ignored.
- Show the values associated with the key outkey instead of the manual descriptions.
- Restrict the search to pages for the specified machine(1) architecture. arch is case insensitive. By default, pages for all architectures are shown.
- Restrict the search to the specified section of the manual. By default, pages from all sections are shown. See man(1) for a listing of sections.
- Instead of showing title lines, show the pathnames of the matching manual
pages, just like man(1)
An expression consists of search terms
joined by logical operators
-a (and) and
-o (or). The
-a operator has
-o and both are evaluated
- ( expr )
- True if the subexpression expr is true.
- True if both expr1 and expr2 are true (logical ‘and’).
- expr1 [
- True if expr1 and/or expr2 evaluate to true (logical ‘or’).
- True if term is satisfied. This has syntax
~)]val, where key is an mdoc(7) macro to query and val is its value. See Macro Keys for a list of available keys. Operator
=evaluates a substring, while
~evaluates a regular expression.
- If term is a regular expression, it is evaluated case-insensitively. Has no effect on substring terms.
Results are sorted by manual sections and names, with output formatted as
Where “name” is the manual's name, “sec” is the manual section, and “description” is the manual's short description. If an architecture is specified for the manual, it is displayed as
Resulting manuals may be accessed as
$ man -s sec name
If an architecture is specified in the output, use
$ man -s sec -S arch name
Queries evaluate over a subset of
mdoc(7) macros indexed by
makewhatis(8). In addition to the macro keys listed below,
the special key
any may be used to match any
available macro key.
Names and description:
||one-line manual description|
||machine architecture (case-insensitive)|
||manual section number|
Sections and cross references:
||section header (excluding standard sections)|
||cross reference to another manual page|
Semantic markup for command line utilities:
||command line options (flags)|
||internal or interactive command|
||file system path|
Semantic markup for function libraries:
||function library name|
||function return type|
||function argument type and name|
||defined variable or preprocessor constant|
Various semantic markup:
||kernel configuration declaration|
||italic font or underline|
||reference to a standards document|
||AT&T UNIX version reference|
||BSD version reference|
||BSD/OS version reference|
||NetBSD version reference|
||FreeBSD version reference|
||OpenBSD version reference|
||DragonFly version reference|
- Any non-empty value of the environment variable
MANPAGERwill be used instead of the standard pagination program, more(1).
- 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
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.
- Specifies the pagination program to use when
MANPAGERis not defined. If neither PAGER nor MANPAGER is defined, more(1)
-swill be used.
- name of the makewhatis(8) keyword database
- default man(1) configuration file
apropos utility exits 0 on
success, and >0 if an error occurs.
Search for ".cf" as a substring of manual names and descriptions:
$ apropos .cf
Include matches for ".cnf" and ".conf" as well:
$ apropos .cf .cnf .conf
Search in names and descriptions using a regular expression:
$ apropos '~set.?[ug]id'
Search for manuals in the library section mentioning both the "optind" and the "optarg" variables:
$ apropos -s 3 Va=optind -a Va=optarg
Do exactly the same as calling whatis(1) with the argument "ssh":
$ apropos -- -i 'Nm~[[:<:]]ssh[[:>:]]'
The following two invocations are equivalent:
$ apropos -Sarch
$ apropos \(expression
man(1), re_format(7), makewhatis(8)
Part of the functionality of
already provided by the former
manwhere utility in
whatis utilities first appeared in
2BSD. They were rewritten from scratch for
-M option and the
MANPATH variable first appeared in
-s in OpenBSD 4.5 for
apropos and in OpenBSD 5.6
Bill Joy wrote
manwhere in 1977 and the original
whatis in February 1979. The current version was
written by Kristaps Dzonsons