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