summaryrefslogtreecommitdiffstats
path: root/apropos.1
blob: e0639cff3474596ace61e019290b18f23e00a1a4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
.\"	$Id$
.\"
.\" Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate$
.Dt APROPOS 1
.Os
.Sh NAME
.Nm apropos ,
.Nm whatis
.Nd search manual page databases
.Sh SYNOPSIS
.Nm
.Op Fl C Ar file
.Op Fl M Ar path
.Op Fl m Ar path
.Op Fl S Ar arch
.Op Fl s Ar section
.Ar expression ...
.Sh DESCRIPTION
The
.Nm apropos
and
.Nm whatis
utilities query manual page databases generated by
.Xr mandocdb 8 ,
evaluating on
.Ar expression
for each file in each database.
.Pp
By default,
.Nm
searches for
.Xr mandocdb 8
databases in the default paths stipulated by
.Xr man 1
and
maps terms to case-sensitive manual names and descriptions.
Multiple terms are OR'd.
.Nm whatis
maps terms only to case-sensitive manual names.
.Pp
Its arguments are as follows:
.Bl -tag -width Ds
.It Fl C Ar file
Specify an alternative configuration
.Ar file
in
.Xr man.conf 5
format.
.It Fl M Ar path
Use the colon-separated path instead of the default list of paths
searched for
.Xr mandocdb 8
databases.
Invalid paths, or paths without manual databases, are ignored.
.It Fl m Ar path
Prepend the colon-separated paths to the list of paths searched
for
.Xr mandocdb 8
databases.
Invalid paths, or paths without manual databases, are ignored.
.It Fl S Ar arch
Search only for a particular architecture.
.It Fl s Ar cat
Search only for a manual section.
See
.Xr man 1
for a listing of manual sections.
.El
.Pp
.Nm whatis
considers an
.Ar expression
to consist of an opaque keyword.
.Nm apropos
parses a
.Ar expression
into type and keyword pairs.
This pair syntax
.Li [key[,key]*(=~)]?val ,
where operand
.Cm key
is an
.Xr mdoc 7
macro to query and
.Cm val
is its value.
See
.Sx Macro Keys
for a list of available keys.
Operator
.Li \&=
evaluates a full string, while
.Li \&~
evaluates a
.Xr glob 7
pattern.
.Pp
Results are sorted by manual title, with output formatted as
.Qq title(sec) \- description
where
.Qq title
is the manual's title (note multiple manual names may exist for one
title),
.Qq sec
is the manual section, and
.Qq description
is the manual's short description.
If an architecture is specified for the manual, it is displayed as
.Qq title(cat/arch) \- description .
.Ss Macro Keys
.Nm apropos
queries evaluate over a subset of
.Xr mdoc 7
macros indexed by
.Xr mandocdb 8 .
In addition to the macro keys listed below, the special key
.Cm any
may be used to match any available macro key.
.Pp
Names and description:
.Bl -column "xLix" description -offset indent -compact
.It Li \&Nm Ta manual name
.It Li \&Nd Ta one-line manual description
.El
.Pp
Sections and cross references:
.Bl -column "xLix" description -offset indent -compact
.It Li \&Sh Ta section header (excluding standard sections)
.It Li \&Ss Ta subsection header
.It Li \&Xr Ta cross reference to another manual page
.It Li \&Rs Ta bibliographic reference
.El
.Pp
Semantic markup for command line utilities:
.Bl -column "xLix" description -offset indent -compact
.It Li \&Fl Ta command line options (flags)
.It Li \&Cm Ta command modifier
.It Li \&Ar Ta command argument
.It Li \&Ic Ta internal or interactive command
.It Li \&Ev Ta environmental variable
.It Li \&Pa Ta file system path
.El
.Pp
Semantic markup for function libraries:
.Bl -column "xLix" description -offset indent -compact
.It Li \&Lb Ta function library name
.It Li \&In Ta include file
.It Li \&Ft Ta function return type
.It Li \&Fn Ta function name
.It Li \&Fa Ta function argument type and name
.It Li \&Vt Ta variable type
.It Li \&Va Ta variable name
.It Li \&Dv Ta defined variable or preprocessor constant
.It Li \&Er Ta error constant
.It Li \&Ev Ta environmental variable
.El
.Pp
Various semantic markup:
.Bl -column "xLix" description -offset indent -compact
.It Li \&An Ta author name
.It Li \&Lk Ta hyperlink
.It Li \&Mt Ta Do mailto Dc hyperlink
.It Li \&Cd Ta kernel configuration declaration
.It Li \&Ms Ta mathematical symbol
.It Li \&Tn Ta tradename
.El
.Pp
Physical markup:
.Bl -column "xLix" description -offset indent -compact
.It Li \&Em Ta italic font or underline
.It Li \&Sy Ta boldface font
.It Li \&Li Ta typewriter font
.El
.Pp
Text production:
.Bl -column "xLix" description -offset indent -compact
.It Li \&St Ta reference to a standards document
.It Li \&At Ta At No version reference
.It Li \&Bx Ta Bx No version reference
.It Li \&Bsx Ta Bsx No version reference
.It Li \&Nx Ta Nx No version reference
.It Li \&Fx Ta Fx No version reference
.It Li \&Ox Ta Ox No version reference
.It Li \&Dx Ta Dx No version reference
.El
.Sh ENVIRONMENT
.Bl -tag -width Ds
.It Ev MANPATH
Colon-separated paths modifying the default list of paths searched for
manual databases.
Invalid paths, or paths without manual databases, are ignored.
Overridden by
.Fl M .
If
.Ev MANPATH
begins with a
.Sq \&: ,
it is appended to the default list;
else if it ends with
.Sq \&: ,
it is prepended to the default list; else if it contains
.Sq \&:: ,
the default list is inserted between the colons.
If none of these conditions are met, it overrides the default list.
.El
.Sh FILES
.Bl -tag -width "/etc/man.conf" -compact
.It Pa mandoc.db
name of the
.Xr mandocdb 8
keyword database
.It Pa /etc/man.conf
default
.Xr man 1
configuration file
.El
.Sh EXIT STATUS
.Ex -std
.Sh EXAMPLES
Search for
.Qq mdoc
as a word or
.Xr glob 7
expression:
.Pp
.Dl $ apropos mdoc
.Dl $ apropos any~mdoc*
.Pp
Include matches for
.Qq roff
and
.Qq man
using
.Xr glob 7
expressions:
.Pp
.Dl $ apropos ~*mdoc* ~*roff*
.Pp
Search for
.Qq optarg
as a variable name in the library category:
.Pp
.Dl $ apropos \-s 3 Va=optarg
.Sh SEE ALSO
.Xr glob 7 ,
.Xr mandocdb 8
.Sh AUTHORS
The
.Nm
utility was written by
.An Kristaps Dzonsons Aq Mt kristaps@bsd.lv .