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. Words which are part of other 43words are considered; for example, when looking for 44.Sq compile , 45.Nm apropos 46finds all instances of 47.Sq compiler 48also. 49.Lp 50The 51.Nm whatis 52command performs the same search, but only matches whole words. In the above 53example, 54.Nm whatis 55would not match the instances of 56.Sq compiler 57when 58.Ar keyword 59is 60.Sq compile . 61.Lp 62The 63.Nm apropos 64command is actually just the 65.Fl k 66option to the 67.Xr man 1 68command. 69.Sh OPTIONS 70.Bl -tag -width "-s section" 71.It Fl M Ar path 72Force a specific colon separated manual path instead of the 73default search path. Overrides the MANPATH environment variable. 74.It Fl s Ar section 75Restrict search to specified section. 76.El 77.Sh ENVIRONMENT 78.Bl -tag -width "MANPATH, PATH" 79.It Ev MANPATH , PATH 80Used to find the location of the 81.Nm whatis 82database. 83.El 84.Sh FILES 85.Bl -tag -width "/usr/share/man/whatis" 86.It Pa /usr/share/man/whatis 87table of contents and keyword database 88.El 89.Sh EXAMPLES 90.Ss Example 1 To find a man page whose NAME line contains a keyword 91Try 92.Lp 93.Dl example% apropos password 94.Lp 95If the line starts 96.So Ar filename Ns Po Ar section Pc .\|.\|. Sc 97you can run 98.Lp 99.Dl % Nm man Fl s Ar section Ar filename 100.Lp 101to display the man page for \fIfilename\fR. 102.Ss Example 2 To find the man page for the subroutine \fBprintf() 103Try 104.Lp 105.Dl example% Nm apropos Li format 106.Lp 107and then 108.Lp 109.Dl example% Nm man Fl s Ar 3C Li printf 110.Lp 111to get the manual page on the subroutine 112.Xr printf 3C . 113.Sh DIAGNOSTICS 114.Bl -tag -width Ds 115.It "/usr/share/man/whatis: No such file or directory" 116The 117.Nm whatis 118database does not exist. 119The command 120.Nm man 121.Fl w 122must be run to create it. 123.El 124.Sh CODE SET INDEPENDENCE 125Enabled. 126.Sh INTERFACE STABILITY 127.Nm Committed . 128.Sh SEE ALSO 129.Xr man 1 , 130.Xr catman 1M 131