1 .\" $Id: apropos.1,v 1.49 2018/11/22 12:33:52 schwarze Exp $
3 .\" Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
4 .\" Copyright (c) 2011,2012,2014,2017,2018 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: November 22 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 extended regular expression matching
55 over manual names and descriptions
56 .Pq the Li \&Nm No and Li \&Nd No macro keys .
57 Multiple terms imply pairwise
65 The options are as follows:
68 Instead of showing only the title lines, show the complete manual pages,
73 If the standard output is a terminal device and
84 manual are also available.
86 Specify an alternative configuration
92 Search for all words in
94 in manual page names only.
95 The search is case-insensitive and matches whole words only.
96 In this mode, macro keys, comparison operators, and logical operators
102 It is the default for
105 Use the colon-separated path instead of the default list of paths
109 Invalid paths, or paths without manual databases, are ignored.
111 Prepend the colon-separated paths to the list of paths searched
115 Invalid paths, or paths without manual databases, are ignored.
117 Show the values associated with the key
119 instead of the manual descriptions.
121 Restrict the search to pages for the specified
126 By default, pages for all architectures are shown.
128 Restrict the search to the specified section of the manual.
129 By default, pages from all sections are shown.
132 for a listing of sections.
137 are also supported and are documented in
141 are mutually exclusive and override each other.
145 consists of search terms joined by logical operators
153 operator has precedence over
155 and both are evaluated left-to-right.
157 .It \&( Ar expr No \&)
158 True if the subexpression
161 .It Ar expr1 Fl a Ar expr2
168 .It Ar expr1 Oo Fl o Oc Ar expr2
173 evaluate to true (logical
182 .Op Ar key Op , Ar key ...
196 for a list of available keys.
199 evaluates a substring, while
201 evaluates a case-sensitive extended regular expression.
205 is a regular expression, it
206 is evaluated case-insensitively.
207 Has no effect on substring terms.
210 Results are sorted first according to the section number in ascending
211 numerical order, then by the page name in ascending
213 alphabetical order, case-insensitive.
215 Each output line is formatted as
217 .D1 name[, name...](sec) \- description
221 is the manual's name,
223 is the manual section, and
225 is the manual's short description.
226 If an architecture is specified for the manual, it is displayed as
228 .D1 name(sec/arch) \- description
230 Resulting manuals may be accessed as
232 .Dl $ man \-s sec name
234 If an architecture is specified in the output, use
236 .Dl $ man \-s sec \-S arch name
238 Queries evaluate over a subset of
242 In addition to the macro keys listed below, the special key
244 may be used to match any available macro key.
246 Names and description:
247 .Bl -column "xLix" description -offset indent -compact
248 .It Li \&Nm Ta manual name
249 .It Li \&Nd Ta one-line manual description
250 .It Li arch Ta machine architecture (case-insensitive)
251 .It Li sec Ta manual section number
254 Sections and cross references:
255 .Bl -column "xLix" description -offset indent -compact
256 .It Li \&Sh Ta section header (excluding standard sections)
257 .It Li \&Ss Ta subsection header
258 .It Li \&Xr Ta cross reference to another manual page
259 .It Li \&Rs Ta bibliographic reference
262 Semantic markup for command line utilities:
263 .Bl -column "xLix" description -offset indent -compact
264 .It Li \&Fl Ta command line options (flags)
265 .It Li \&Cm Ta command modifier
266 .It Li \&Ar Ta command argument
267 .It Li \&Ic Ta internal or interactive command
268 .It Li \&Ev Ta environmental variable
269 .It Li \&Pa Ta file system path
272 Semantic markup for function libraries:
273 .Bl -column "xLix" description -offset indent -compact
274 .It Li \&Lb Ta function library name
275 .It Li \&In Ta include file
276 .It Li \&Ft Ta function return type
277 .It Li \&Fn Ta function name
278 .It Li \&Fa Ta function argument type and name
279 .It Li \&Vt Ta variable type
280 .It Li \&Va Ta variable name
281 .It Li \&Dv Ta defined variable or preprocessor constant
282 .It Li \&Er Ta error constant
283 .It Li \&Ev Ta environmental variable
286 Various semantic markup:
287 .Bl -column "xLix" description -offset indent -compact
288 .It Li \&An Ta author name
289 .It Li \&Lk Ta hyperlink
290 .It Li \&Mt Ta Do mailto Dc hyperlink
291 .It Li \&Cd Ta kernel configuration declaration
292 .It Li \&Ms Ta mathematical symbol
293 .It Li \&Tn Ta tradename
297 .Bl -column "xLix" description -offset indent -compact
298 .It Li \&Em Ta italic font or underline
299 .It Li \&Sy Ta boldface font
300 .It Li \&Li Ta typewriter font
304 .Bl -column "xLix" description -offset indent -compact
305 .It Li \&St Ta reference to a standards document
306 .It Li \&At Ta At No version reference
307 .It Li \&Bx Ta Bx No version reference
308 .It Li \&Bsx Ta Bsx No version reference
309 .It Li \&Nx Ta Nx No version reference
310 .It Li \&Fx Ta Fx No version reference
311 .It Li \&Ox Ta Ox No version reference
312 .It Li \&Dx Ta Dx No version reference
315 In general, macro keys are supposed to yield complete results without
316 expecting the user to consider actual macro usage.
317 For example, results include:
319 .Bl -tag -width 3n -offset 3n -compact
321 function arguments appearing on
325 function names marked up with
329 include file names marked up with
333 types appearing as function return types and
335 types appearing in function arguments in the SYNOPSIS
338 .Bl -tag -width MANPAGER
340 Any non-empty value of the environment variable
342 is used instead of the standard pagination program,
353 A colon-separated list of directories to search for manual pages; see
362 Specifies the pagination program to use when
365 If neither PAGER nor MANPAGER is defined,
376 .Bl -tag -width "/etc/man.conf" -compact
391 as a substring of manual names and descriptions:
401 .Dl $ apropos =.cf =.cnf =.conf
403 Search in names and descriptions using a case-sensitive regular expression:
405 .Dl $ apropos \(aq\(tiset.?[ug]id\(aq
407 Search for manuals in the library section mentioning both the
413 .Dl $ apropos \-s 3 Va=optind \-a Va=optarg
415 Do exactly the same as calling
420 .Dl $ apropos \-\- \-i \(aqNm\(ti[[:<:]]ssh[[:>:]]\(aq
422 The following two invocations are equivalent:
424 .D1 Li $ apropos -S Ar arch Li -s Ar section expression
425 .Bd -ragged -offset indent
426 .Li $ apropos \e( Ar expression Li \e)
427 .Li -a arch\(ti^( Ns Ar arch Ns Li |any)$
428 .Li -a sec\(ti^ Ns Ar section Ns Li $
437 utility is compliant with the
445 command, support for logical operators, macro keys,
446 substring matching, sorting of results, the environment variables
450 the database format, and the configuration file
451 are extensions to that specification.
453 Part of the functionality of
455 was already provided by the former
463 utilities first appeared in
465 They were rewritten from scratch for
472 variable first appeared in
501 in 1977 and the original
507 The current version was written by
508 .An Kristaps Dzonsons Aq Mt kristaps@bsd.lv
510 .An Ingo Schwarze Aq Mt schwarze@openbsd.org .