1 .\"
2 .\" This file and its contents are supplied under the terms of the
3 .\" Common Development and Distribution License ("CDDL"), version 1.0.
4 .\" You may only use this file in accordance with the terms of version
5 .\" 1.0 of the CDDL.
6 .\"
7 .\" A full copy of the text of the CDDL should have accompanied this
8 .\" source. A copy of the CDDL is also available via the Internet at
9 .\" http://www.illumos.org/license/CDDL.
10 .\"
11 .\"
12 .\" Copyright 2012 Nexenta Systems, Inc. All rights reserved.
13 .\" Copyright 2014 Garrett D'Amore <garrett@damore.org>
14 .\"
15 .Dd Jul 18, 2014
16 .Dt APROPOS 1
17 .Os
18 .Sh NAME
19 .Nm apropos ,
20 .Nm whatis
21 .Nd keyword search in
22 .Nm whatis
23 database files
24 .Sh SYNOPSIS
25 .Nm
26 .Op Fl M Ar path
27 .Op Fl s Ar section
28 .Ar keyword ...
29 .Nm whatis
30 .Op Fl M Ar path
31 .Op Fl s Ar section
32 .Ar keyword ...
33 .Sh DESCRIPTION
34 The
35 .Nm
36 utility searches a set of
37 .Nm whatis
38 database files matching each
39 .Ar keyword .
40 The
41 .Nm whatis
42 utility does the same search but only on complete words. The
43 .Nm whatis
44 database files are created using the
45 .Xr man 1
46 command.
47 .Sh OPTIONS
48 .Bl -tag -width ".Fl d"
49 .It Fl M Ar path
50 Force a specific colon separated manual path instead of the default search path.
51 Overrides the
52 .Ev MANPATH
53 environment variable.
54 .It Fl s Ar section
55 Restrict search to specified
56 .Ar section .
57 .El
58 .Sh ENVIRONMENT
59 The following environment variables affect the execution of
60 .Nm :
61 .Bl -tag -width ".Ev MANPATH , PATH"
62 .It Ev MANPATH , PATH
63 Used to find the location of the
64 .Nm whatis
65 database files.
66 .El
67 .Sh DIAGNOSTICS
68 The
69 .Nm
70 utility exits 0 if a keyword matched and 1 if no keywords are matched or no
71 .Nm whatis
72 databases are found.
73 .Sh INTERFACE STABILITY
74 .Nm Committed .
75 .Sh CODE SET INDEPENDENCE
76 Enabled.
77 .Sh SEE ALSO
78 .Xr man 1 ,
79 .Xr mandoc 1
|
1 .\" Copyright (c) 1996, Sun Microsystems, Inc. All Rights Reserved
2 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
3 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
4 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
5 .Dd "Jul 20, 2014"
6 .Dt APROPOS 1
7 .Os
8 .Sh NAME
9 .Nm apropos, whatis
10 .Nd locate commands by keyword lookup
11 .Sh SYNOPSIS
12 .Nm apropos
13 .Op Fl M Ar path
14 .Op Fl s Ar section
15 .Ar keyword ...
16 .Nm whatis
17 .Op Fl M Ar path
18 .Op Fl s Ar section
19 .Ar keyword ...
20 .Sh DESCRIPTION
21 The
22 .Nm apropos
23 utility displays the man page name, section number, and a
24 short description for each man page whose
25 .Em NAME
26 line contains
27 .Ar keyword .
28 This information is contained in the
29 .Nm whatis
30 database created by the
31 .Fl w
32 option used with
33 .Xr man 1 .
34 If this database is not present,
35 .Nm apropos
36 and
37 .Nm whatis
38 fail.
39 .Lp
40 Each word is considered
41 separately and the case of letters is ignored. Words which are part of other
42 words are considered; for example, when looking for
43 .Sq compile ,
44 .Nm apropos
45 finds all instances of
46 .Sq compiler
47 also.
48 .Lp
49 The
50 .Nm whatis
51 command performs the same search, but only matches whole words. In the above
52 example,
53 .Nm whatis
54 would not match the instances of
55 .Sq compiler
56 when
57 .Ar keyword
58 is
59 .Sq compile .
60 .Lp
61 The
62 .Nm apropos
63 command is actually just the
64 .Fl -k
65 option to the
66 .Xr man 1
67 command.
68 .Sh OPTIONS
69 .Bl -tag -width "-s section"
70 .It Fl M Ar path
71 Force a specific colon separated manual path instead of the
72 default search path. Overrides the MANPATH environment variable.
73 .It Fl s Ar section
74 Restrict search to specified section.
75 .El
76 .Sh ENVIRONMENT
77 .Bl -tag -width "MANPATH, PATH"
78 .It Ev MANPATH , PATH
79 Used to find the location of the
80 .Nm whatis
81 database.
82 .El
83 .Sh FILES
84 .Bl -tag -width "/usr/share/man/whatis"
85 .It Pa /usr/share/man/whatis
86 table of contents and keyword database
87 .El
88 .Sh EXAMPLES
89 .Ss Example 1 To find a man page whose NAME line contains a keyword
90 Try
91 .Lp
92 .Dl example% apropos password
93 .Lp
94 If the line starts
95 .So Ar filename Ns Po Ar section Pc .\|.\|. Sc
96 you can run
97 .Lp
98 .Dl % Nm man Fl s Ar section Ar filename
99 .Lp
100 to display the man page for \fIfilename\fR.
101 .Ss Example 2 To find the man page for the subroutine \fBprintf()
102 Try
103 .Lp
104 .Dl example% Nm apropos Li format
105 .Lp
106 and then
107 .Lp
108 .Dl example% Nm man Fl s Ar 3C Li printf
109 .Lp
110 to get the manual page on the subroutine
111 .Xr printf 3C .
112 .Sh DIAGNOSTICS
113 .Bl -tag -width Ds
114 .It "/usr/share/man/whatis: No such file or directory"
115 The
116 .Nm whatis
117 database does not exist.
118 The command
119 .Nm man
120 .Fl w
121 must be run to create it.
122 .El
123 .Sh CODE SET INDEPENDENCE
124 Enabled.
125 .Sh INTERFACE STABILITY
126 .Nm Committed .
127 .Sh SEE ALSO
128 .Xr man 1 ,
129 .Xr catman 1M
|