]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.bin/whereis/whereis.1
This commit was generated by cvs2svn to compensate for changes in r127804,
[FreeBSD/FreeBSD.git] / usr.bin / whereis / whereis.1
1 .\" Copyright (c) 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Copyright 2002      Joerg Wunsch
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\"    notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\"    notice, this list of conditions and the following disclaimer in the
13 .\"    documentation and/or other materials provided with the distribution.
14 .\" 3. All advertising materials mentioning features or use of this software
15 .\"    must display the following acknowledgement:
16 .\"     This product includes software developed by the University of
17 .\"     California, Berkeley and its contributors.
18 .\" 4. Neither the name of the University nor the names of its contributors
19 .\"    may be used to endorse or promote products derived from this software
20 .\"    without specific prior written permission.
21 .\"
22 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" SUCH DAMAGE.
33 .\"
34 .\"     @(#)whereis.1   8.2 (Berkeley) 12/30/93
35 .\"
36 .\" $FreeBSD$
37 .\"
38 .Dd August 22, 2002
39 .Dt WHEREIS 1
40 .Os
41 .Sh NAME
42 .Nm whereis
43 .Nd locate programs
44 .Sh SYNOPSIS
45 .Nm
46 .Op Fl abmqsux
47 .Op Fl BMS Ar dir ... Fl f
48 .Ar program ...
49 .Sh DESCRIPTION
50 The
51 .Nm
52 utility checks the standard binary, manual page, and source
53 directories for the specified programs, printing out the paths of any
54 it finds.  The supplied program names are first stripped of leading
55 path name components, any single trailing extension added by
56 .Xr gzip 1 ,
57 .Xr compress 1 ,
58 or
59 .Xr bzip2 1 ,
60 and the leading
61 .Ql s.\&
62 or trailing
63 .Ql ,v
64 from a source code control system.
65 .Pp
66 The default path searched is the string returned by the
67 .Xr sysctl 8
68 utility for the
69 .Dq user.cs_path
70 string, with
71 .Pa /usr/libexec ,
72 .Pa /usr/games
73 and the current user's
74 .Ev $PATH
75 appended.  Manual pages are searched by default along the
76 .Ev $MANPATH .
77 Program sources are located in a list of known standard places,
78 including all the subdirectories of
79 .Pa /usr/src
80 and
81 .Pa /usr/ports .
82 .Pp
83 The following options are available:
84 .Bl -tag -width indent
85 .It Fl B
86 Specify directories to search for binaries.  Requires the
87 .Fl f
88 option.
89 .It Fl M
90 Specify directories to search for manual pages.  Requires the
91 .Fl f
92 option.
93 .It Fl S
94 Specify directories to search for program sources.  Requires the
95 .Fl f
96 option.
97 .It Fl a
98 Report all matches instead of only the first of each requested type.
99 .It Fl b
100 Search for binaries.
101 .It Fl f
102 Delimits the list of directories after the
103 .Fl B ,
104 .Fl M ,
105 or
106 .Fl S
107 options, and indicates the beginning of the
108 .Ar program
109 list.
110 .It Fl m
111 Search for manual pages.
112 .It Fl q
113 .Pq Dq quiet .
114 Suppress the output of the utility name in front of the normal
115 output line.
116 This can become handy for use in a backquote substitution of a
117 shell command line, see
118 .Sx EXAMPLES .
119 .It Fl s
120 Search for source directories.
121 .It Fl u
122 Search for
123 .Dq unusual
124 entries.  A file is said to be unusual if it does not have at least
125 one entry of each requested type.
126 Only the name of the unusual entry is printed.
127 .It Fl x
128 Do not use
129 .Dq expensive
130 tools when searching for source directories.
131 Normally, after unsuccessfully searching all the first-level
132 subdirectories of the source directory list,
133 .Nm
134 will ask
135 .Xr locate 1
136 to find the entry on its behalf.
137 Since this can take much longer, it can be turned off with
138 .Fl x .
139 .El
140 .Sh EXAMPLES
141 The following finds all utilities under
142 .Pa /usr/bin
143 that do not have documentation:
144 .Pp
145 .Dl whereis -m -u /usr/bin/*
146 .Pp
147 Change to the source code directory of
148 .Xr ls 1 :
149 .Pp
150 .Dl cd `whereis -sq ls`
151 .Sh SEE ALSO
152 .Xr find 1 ,
153 .Xr locate 1 ,
154 .Xr man 1 ,
155 .Xr which 1 ,
156 .Xr sysctl 8
157 .Sh HISTORY
158 The
159 .Nm
160 utility appeared in
161 .Bx 3.0 .
162 This version re-implements the historical
163 functionality that was lost in
164 .Bx 4.4 .
165 .Sh AUTHORS
166 This implementation of the
167 .Nm
168 command was written by
169 .An J\(:org Wunsch .
170 .Sh BUGS
171 This re-implementation of the
172 .Nm
173 utility is not bug-for-bug compatible with historical versions.
174 It is believed to be compatible with the version that was shipping with
175 .Fx 2.2
176 through
177 .Fx 4.5
178 though.
179 .Pp
180 The
181 .Nm
182 utility can report some unrelated source entries when the
183 .Fl a
184 option is specified.