xref: /illumos-gate/usr/src/man/man1/apropos.1 (revision 533affcbc7fc4d0c8132976ea454aaa715fe2307)
1.\" Copyright 2014 Garrett D'Amore <garrett@damore.org>
2.\"  Copyright (c) 1996, Sun Microsystems, Inc.  All Rights Reserved
3.\" 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.
4.\" 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.
5.\" 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]
6.Dd "Jul 20, 2014"
7.Dt APROPOS 1
8.Os
9.Sh NAME
10.Nm apropos, whatis
11.Nd locate commands by keyword lookup
12.Sh SYNOPSIS
13.Nm apropos
14.Op Fl M Ar path
15.Op Fl s Ar section
16.Ar keyword ...
17.Nm whatis
18.Op Fl M Ar path
19.Op Fl s Ar section
20.Ar keyword ...
21.Sh DESCRIPTION
22The
23.Nm apropos
24utility displays the man page name, section number, and a
25short description for each man page whose
26.Em NAME
27line contains
28.Ar keyword .
29This information is contained in the
30.Nm whatis
31database created by the
32.Fl w
33option used with
34.Xr man 1 .
35If this database is not present,
36.Nm apropos
37and
38.Nm whatis
39fail.
40.Lp
41Each word is considered
42separately and the case of letters is ignored.
43Words which are part of other words are considered; for example, when looking
44for
45.Sq compile ,
46.Nm apropos
47finds all instances of
48.Sq compiler
49also.
50.Lp
51The
52.Nm whatis
53command performs the same search, but only matches whole words.
54In the above example,
55.Nm whatis
56would not match the instances of
57.Sq compiler
58when
59.Ar keyword
60is
61.Sq compile .
62.Lp
63The
64.Nm apropos
65command is actually just the
66.Fl k
67option to the
68.Xr man 1
69command.
70.Sh OPTIONS
71.Bl -tag -width "-s section"
72.It Fl M Ar path
73Force a specific colon separated manual path instead of the
74default search path.
75Overrides the MANPATH environment variable.
76.It Fl s Ar section
77Restrict search to specified section.
78.El
79.Sh ENVIRONMENT
80.Bl -tag -width "MANPATH, PATH"
81.It Ev MANPATH , PATH
82Used to find the location of the
83.Nm whatis
84database.
85.El
86.Sh FILES
87.Bl -tag -width "/usr/share/man/whatis"
88.It Pa /usr/share/man/whatis
89table of contents and keyword database
90.El
91.Sh EXAMPLES
92.Ss Example 1 To find a man page whose NAME line contains a keyword
93Try
94.Lp
95.Dl example% apropos password
96.Lp
97If the line starts
98.So Ar filename Ns Po Ar section Pc ... Sc
99you can run
100.Lp
101.Dl % Nm man Fl s Ar section Ar filename
102.Lp
103to display the man page for
104.Ar filename .
105.Ss Example 2 To find the man page for the subroutine printf()
106Try
107.Lp
108.Dl example% Nm apropos Li format
109.Lp
110and then
111.Lp
112.Dl example% Nm man Fl s Ar 3C Li printf
113.Lp
114to get the manual page on the subroutine
115.Xr printf 3C .
116.Sh DIAGNOSTICS
117.Bl -tag -width Ds
118.It "/usr/share/man/whatis: No such file or directory"
119The
120.Nm whatis
121database does not exist.
122The command
123.Nm man
124.Fl w
125must be run to create it.
126.El
127.Sh CODE SET INDEPENDENCE
128Enabled.
129.Sh INTERFACE STABILITY
130.Nm Committed .
131.Sh SEE ALSO
132.Xr man 1 ,
133.Xr catman 8
134