1 .\" $Id: apropos.1,v 1.47 2018/02/23 18:54:02 schwarze Exp $
3 .\" Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
4 .\" Copyright (c) 2011, 2012, 2014, 2017 Ingo Schwarze <schwarze@openbsd.org>
6 .\" Permission to use, copy, modify, and distribute this software for any
7 .\" purpose with or without fee is hereby granted, provided that the above
8 .\" copyright notice and this permission notice appear in all copies.
10 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 .Dd $Mdocdate: February 23 2018 $
24 .Nd search manual page databases
40 utilities query manual page databases generated by
44 for each file in each database.
45 By default, they display the names, section numbers, and description lines
46 of all matching manuals.
52 databases in the default paths stipulated by
54 and uses case-insensitive substring matching
55 .Pq the Cm = No operator
56 over manual names and descriptions
57 .Pq the Li \&Nm No and Li \&Nd No macro keys .
58 Multiple terms imply pairwise
66 The options are as follows:
69 Instead of showing only the title lines, show the complete manual pages,
74 If the standard output is a terminal device and
85 manual are also available.
87 Specify an alternative configuration
93 Search for all words in
95 in manual page names only.
96 The search is case insensitive and matches whole words only.
97 In this mode, macro keys, comparison operators, and logical operators
103 It is the default for
106 Use the colon-separated path instead of the default list of paths
110 Invalid paths, or paths without manual databases, are ignored.
112 Prepend the colon-separated paths to the list of paths searched
116 Invalid paths, or paths without manual databases, are ignored.
118 Show the values associated with the key
120 instead of the manual descriptions.
122 Restrict the search to pages for the specified
127 By default, pages for all architectures are shown.
129 Restrict the search to the specified section of the manual.
130 By default, pages from all sections are shown.
133 for a listing of sections.
138 are also supported and are documented in
142 are mutually exclusive and override each other.
146 consists of search terms joined by logical operators
154 operator has precedence over
156 and both are evaluated left-to-right.
158 .It \&( Ar expr No \&)
159 True if the subexpression
162 .It Ar expr1 Fl a Ar expr2
169 .It Ar expr1 Oo Fl o Oc Ar expr2
174 evaluate to true (logical
183 .Op Ar key Op , Ar key ...
197 for a list of available keys.
200 evaluates a substring, while
202 evaluates a regular expression.
206 is a regular expression, it
207 is evaluated case-insensitively.
208 Has no effect on substring terms.
211 Results are sorted according to the following criteria:
214 The manpath directory tree the page is found in, according to the
220 environment variable, the
222 configuration file, or the default documented in
225 The section number in ascending numerical order.
227 The page name in ascending
229 alphabetical order, case-insensitive.
232 Each output line is formatted as
234 .D1 name[, name...](sec) \- description
238 is the manual's name,
240 is the manual section, and
242 is the manual's short description.
243 If an architecture is specified for the manual, it is displayed as
245 .D1 name(sec/arch) \- description
247 Resulting manuals may be accessed as
249 .Dl $ man \-s sec name
251 If an architecture is specified in the output, use
253 .Dl $ man \-s sec \-S arch name
255 Queries evaluate over a subset of
259 In addition to the macro keys listed below, the special key
261 may be used to match any available macro key.
263 Names and description:
264 .Bl -column "xLix" description -offset indent -compact
265 .It Li \&Nm Ta manual name
266 .It Li \&Nd Ta one-line manual description
267 .It Li arch Ta machine architecture (case-insensitive)
268 .It Li sec Ta manual section number
271 Sections and cross references:
272 .Bl -column "xLix" description -offset indent -compact
273 .It Li \&Sh Ta section header (excluding standard sections)
274 .It Li \&Ss Ta subsection header
275 .It Li \&Xr Ta cross reference to another manual page
276 .It Li \&Rs Ta bibliographic reference
279 Semantic markup for command line utilities:
280 .Bl -column "xLix" description -offset indent -compact
281 .It Li \&Fl Ta command line options (flags)
282 .It Li \&Cm Ta command modifier
283 .It Li \&Ar Ta command argument
284 .It Li \&Ic Ta internal or interactive command
285 .It Li \&Ev Ta environmental variable
286 .It Li \&Pa Ta file system path
289 Semantic markup for function libraries:
290 .Bl -column "xLix" description -offset indent -compact
291 .It Li \&Lb Ta function library name
292 .It Li \&In Ta include file
293 .It Li \&Ft Ta function return type
294 .It Li \&Fn Ta function name
295 .It Li \&Fa Ta function argument type and name
296 .It Li \&Vt Ta variable type
297 .It Li \&Va Ta variable name
298 .It Li \&Dv Ta defined variable or preprocessor constant
299 .It Li \&Er Ta error constant
300 .It Li \&Ev Ta environmental variable
303 Various semantic markup:
304 .Bl -column "xLix" description -offset indent -compact
305 .It Li \&An Ta author name
306 .It Li \&Lk Ta hyperlink
307 .It Li \&Mt Ta Do mailto Dc hyperlink
308 .It Li \&Cd Ta kernel configuration declaration
309 .It Li \&Ms Ta mathematical symbol
310 .It Li \&Tn Ta tradename
314 .Bl -column "xLix" description -offset indent -compact
315 .It Li \&Em Ta italic font or underline
316 .It Li \&Sy Ta boldface font
317 .It Li \&Li Ta typewriter font
321 .Bl -column "xLix" description -offset indent -compact
322 .It Li \&St Ta reference to a standards document
323 .It Li \&At Ta At No version reference
324 .It Li \&Bx Ta Bx No version reference
325 .It Li \&Bsx Ta Bsx No version reference
326 .It Li \&Nx Ta Nx No version reference
327 .It Li \&Fx Ta Fx No version reference
328 .It Li \&Ox Ta Ox No version reference
329 .It Li \&Dx Ta Dx No version reference
332 In general, macro keys are supposed to yield complete results without
333 expecting the user to consider actual macro usage.
334 For example, results include:
336 .Bl -tag -width 3n -offset 3n -compact
338 function arguments appearing on
342 fuction names marked up with
346 include file names marked up with
350 types appearing as function return types and
352 types appearing in function arguments in the SYNOPSIS
355 .Bl -tag -width MANPAGER
357 Any non-empty value of the environment variable
359 is used instead of the standard pagination program,
370 A colon-separated list of directories to search for manual pages; see
379 Specifies the pagination program to use when
382 If neither PAGER nor MANPAGER is defined,
393 .Bl -tag -width "/etc/man.conf" -compact
408 as a substring of manual names and descriptions:
418 .Dl $ apropos .cf .cnf .conf
420 Search in names and descriptions using a regular expression:
422 .Dl $ apropos \(aq\(tiset.?[ug]id\(aq
424 Search for manuals in the library section mentioning both the
430 .Dl $ apropos \-s 3 Va=optind \-a Va=optarg
432 Do exactly the same as calling
437 .Dl $ apropos \-\- \-i \(aqNm\(ti[[:<:]]ssh[[:>:]]\(aq
439 The following two invocations are equivalent:
441 .D1 Li $ apropos -S Ar arch Li -s Ar section expression
442 .Bd -ragged -offset indent
443 .Li $ apropos \e( Ar expression Li \e)
444 .Li -a arch\(ti^( Ns Ar arch Ns Li |any)$
445 .Li -a sec\(ti^ Ns Ar section Ns Li $
452 Part of the functionality of
454 was already provided by the former
462 utilities first appeared in
464 They were rewritten from scratch for
471 variable first appeared in
500 in 1977 and the original
506 The current version was written by
507 .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv
509 .An Ingo Schwarze Aq Mt schwarze@openbsd.org .