1APROPOS(1) BSD General Commands Manual APROPOS(1)
2
4 apropos, whatis — search manual page databases
5
7 apropos [-afk] [-C file] [-M path] [-m path] [-O outkey] [-S arch]
8 [-s section] expression ...
9
11 The apropos and whatis utilities query manual page databases generated by
12 makewhatis(8), evaluating expression for each file in each database. By
13 default, they display the names, section numbers, and description lines
14 of all matching manuals.
15
16 By default, apropos searches for makewhatis(8) databases in the default
17 paths stipulated by man(1) and uses case-insensitive substring matching
18 (the = operator) over manual names and descriptions (the Nm and Nd macro
19 keys). Multiple terms imply pairwise -o.
20
21 whatis is a synonym for apropos -f.
22
23 The options are as follows:
24
25 -a Instead of showing only the title lines, show the complete manual
26 pages, just like man(1) -a would. If the standard output is a
27 terminal device and -c is not specified, use more(1) to paginate
28 them. In -a mode, the options -IKOTW described in the mandoc(1)
29 manual are also available.
30
31 -C file
32 Specify an alternative configuration file in man.conf(5) format.
33
34 -f Search for all words in expression in manual page names only.
35 The search is case insensitive and matches whole words only. In
36 this mode, macro keys, comparison operators, and logical opera‐
37 tors are not available.
38
39 -k Support the full expression syntax. It is the default for
40 apropos.
41
42 -M path
43 Use the colon-separated path instead of the default list of paths
44 searched for makewhatis(8) databases. Invalid paths, or paths
45 without manual databases, are ignored.
46
47 -m path
48 Prepend the colon-separated paths to the list of paths searched
49 for makewhatis(8) databases. Invalid paths, or paths without
50 manual databases, are ignored.
51
52 -O outkey
53 Show the values associated with the key outkey instead of the
54 manual descriptions.
55
56 -S arch
57 Restrict the search to pages for the specified machine(1) archi‐
58 tecture. arch is case insensitive. By default, pages for all
59 architectures are shown.
60
61 -s section
62 Restrict the search to the specified section of the manual. By
63 default, pages from all sections are shown. See man(1) for a
64 listing of sections.
65
66 The options -chlw are also supported and are documented in man(1). The
67 options -fkl are mutually exclusive and override each other.
68
69 An expression consists of search terms joined by logical operators -a
70 (and) and -o (or). The -a operator has precedence over -o and both are
71 evaluated left-to-right.
72
73 ( expr )
74 True if the subexpression expr is true.
75
76 expr1 -a expr2
77 True if both expr1 and expr2 are true (logical ‘and’).
78
79 expr1 [-o] expr2
80 True if expr1 and/or expr2 evaluate to true (logical ‘or’).
81
82 term True if term is satisfied. This has syntax
83 [[key[,key...]](=|~)]val, where key is an mdoc(7) macro to query
84 and val is its value. See Macro Keys for a list of available
85 keys. Operator = evaluates a substring, while ~ evaluates a reg‐
86 ular expression.
87
88 -i term
89 If term is a regular expression, it is evaluated case-insensi‐
90 tively. Has no effect on substring terms.
91
92 Results are sorted according to the following criteria:
93
94 1. The manpath directory tree the page is found in, according to the
95 order specified with -M, -m, the MANPATH environment variable, the
96 man.conf(5) configuration file, or the default documented in
97 man.conf(5).
98
99 2. The section number in ascending numerical order.
100
101 3. The page name in ascending ascii(7) alphabetical order, case-insen‐
102 sitive.
103
104 Each output line is formatted as
105
106 name[, name...](sec) - description
107
108 Where “name” is the manual's name, “sec” is the manual section, and
109 “description” is the manual's short description. If an architecture is
110 specified for the manual, it is displayed as
111
112 name(sec/arch) - description
113
114 Resulting manuals may be accessed as
115
116 $ man -s sec name
117
118 If an architecture is specified in the output, use
119
120 $ man -s sec -S arch name
121
122 Macro Keys
123 Queries evaluate over a subset of mdoc(7) macros indexed by
124 makewhatis(8). In addition to the macro keys listed below, the special
125 key any may be used to match any available macro key.
126
127 Names and description:
128 Nm manual name
129 Nd one-line manual description
130 arch machine architecture (case-insensitive)
131 sec manual section number
132
133 Sections and cross references:
134 Sh section header (excluding standard sections)
135 Ss subsection header
136 Xr cross reference to another manual page
137 Rs bibliographic reference
138
139 Semantic markup for command line utilities:
140 Fl command line options (flags)
141 Cm command modifier
142 Ar command argument
143 Ic internal or interactive command
144 Ev environmental variable
145 Pa file system path
146
147 Semantic markup for function libraries:
148 Lb function library name
149 In include file
150 Ft function return type
151 Fn function name
152 Fa function argument type and name
153 Vt variable type
154 Va variable name
155 Dv defined variable or preprocessor constant
156 Er error constant
157 Ev environmental variable
158
159 Various semantic markup:
160 An author name
161 Lk hyperlink
162 Mt “mailto” hyperlink
163 Cd kernel configuration declaration
164 Ms mathematical symbol
165 Tn tradename
166
167 Physical markup:
168 Em italic font or underline
169 Sy boldface font
170 Li typewriter font
171
172 Text production:
173 St reference to a standards document
174 At AT&T UNIX version reference
175 Bx BSD version reference
176 Bsx BSD/OS version reference
177 Nx NetBSD version reference
178 Fx FreeBSD version reference
179 Ox OpenBSD version reference
180 Dx DragonFly version reference
181
182 In general, macro keys are supposed to yield complete results without
183 expecting the user to consider actual macro usage. For example, results
184 include:
185
186 Fa function arguments appearing on Fn lines
187 Fn fuction names marked up with Fo macros
188 In include file names marked up with Fd macros
189 Vt types appearing as function return types and
190 types appearing in function arguments in the SYNOPSIS
191
193 MANPAGER Any non-empty value of the environment variable MANPAGER is
194 used instead of the standard pagination program, more(1); see
195 man(1) for details. Only used if -a or -l is specified.
196
197 MANPATH A colon-separated list of directories to search for manual
198 pages; see man(1) for details. Overridden by -M, ignored if -l
199 is specified.
200
201 PAGER Specifies the pagination program to use when MANPAGER is not
202 defined. If neither PAGER nor MANPAGER is defined, more(1) -s
203 is used. Only used if -a or -l is specified.
204
206 mandoc.db name of the makewhatis(8) keyword database
207 /etc/man.conf default man(1) configuration file
208
210 The apropos utility exits 0 on success, and >0 if an error occurs.
211
213 Search for ".cf" as a substring of manual names and descriptions:
214
215 $ apropos .cf
216
217 Include matches for ".cnf" and ".conf" as well:
218
219 $ apropos .cf .cnf .conf
220
221 Search in names and descriptions using a regular expression:
222
223 $ apropos '~set.?[ug]id'
224
225 Search for manuals in the library section mentioning both the "optind"
226 and the "optarg" variables:
227
228 $ apropos -s 3 Va=optind -a Va=optarg
229
230 Do exactly the same as calling whatis with the argument "ssh":
231
232 $ apropos -- -i 'Nm~[[:<:]]ssh[[:>:]]'
233
234 The following two invocations are equivalent:
235
236 $ apropos -S arch -s section expression
237
238 $ apropos \( expression \) -a arch~^(arch|any)$ -a sec~^section$
239
241 man(1), re_format(7), makewhatis(8)
242
244 Part of the functionality of whatis was already provided by the former
245 manwhere utility in 1BSD. The apropos and whatis utilities first
246 appeared in 2BSD. They were rewritten from scratch for OpenBSD 5.6.
247
248 The -M option and the MANPATH variable first appeared in 4.3BSD; -m in
249 4.3BSD-Reno; -C in 4.4BSD Lite1; and -S and -s in OpenBSD 4.5 for apropos
250 and in OpenBSD 5.6 for whatis. The options -acfhIKklOTWw appeared in
251 OpenBSD 5.7.
252
254 Bill Joy wrote manwhere in 1977 and the original BSD apropos and whatis
255 in February 1979. The current version was written by Kristaps Dzonsons
256 <kristaps@bsd.lv> and Ingo Schwarze <schwarze@openbsd.org>.
257
258BSD June 20, 2019 BSD