Added /usr/gnu and /usr/local/bin as places to look for binaries,
[unix-history] / usr.bin / whereis / whereis.1
CommitLineData
15637ed4
RG
1.\" Copyright (c) 1980, 1990 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\" notice, this list of conditions and the following disclaimer in the
11.\" documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\" must display the following acknowledgement:
14.\" This product includes software developed by the University of
15.\" California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" @(#)whereis.1 6.5 (Berkeley) 4/23/91
33.\"
34.Dd April 23, 1991
35.Dt WHEREIS 1
36.Os BSD 3
37.Sh NAME
38.Nm whereis
39.Nd locate binary, manual, and or source for program
40.Sh SYNOPSIS
41.Nm whereis
42.Op Fl bms
43.Op Fl u
44.Op Fl BMS Ar dir Ar ... Fl f
45.Ar name Ar ...
46.Sh DESCRIPTION
47.Nm Whereis
48locates source/binary and manuals sections for specified files.
49The supplied names are first stripped of leading pathname components
50and of any (single) trailing extension of the form
51.Ql .ext ,
52e.g.
53.Ql \&.c .
54Prefixes of
55.Ql \&.s
56resulting from use of source code control are also
57dealt with.
58.Nm Whereis
59then attempts to locate the desired program in a list of standard places.
60.Pp
61Available options:
62.Bl -tag -width Ds
63.It Fl B
64Change or limit directories searched for binaries. Requires the
65.Fl f
66flag.
67.It Fl M
68Change or limit directories searched for manual entries. Requires the
69.Fl f
70flag.
71.It Fl S
72Change or limit directories searched for source. Requires the
73.Fl f
74flag.
75.It Fl b
76Search for binaries.
77.It Fl f
78Signals the end of a directory list specified by one or more of the
79.Fl B , M
80or
81.Fl S
82options and the start of file
83.Ar names .
84.It Fl m
85Search for manual entries.
86.It Fl s
87Search for source.
88.It Fl u
89Search for unusual entries.
90A file is said to be unusual if it does not have one entry of
91each requested type.
92Thus:
93.Pp
94.Dl whereis -m -u *
95.Pp
96asks for those files in the current
97directory which have no documentation.
98.El
99.Sh EXAMPLE
100The following finds all the files in
101.Pa /usr/bin
102which are not documented
103in
104.Pa /usr/share/man/man1
105with source in
106.Pa /usr/src/cmd:
107.Bd -literal -offset indent -compact
108cd /usr/ucb
109whereis \-u \-M /usr/share/man/man1 \-S /usr/src/cmd \-f *
110.Ed
111.Sh FILES
112.Bl -tag -width /lib,x/etc,x/usr/{lib,bin,ucb,old,new,local} -compact
113.It Pa /usr/src/*
114.It Pa /usr/{doc,man}/*
115.It Pa /lib, /etc, /usr/{lib,bin,ucb,old,new,local}
116.El
117.Sh BUGS
118Since the program uses
119.Xr chdir 2
120to run faster, pathnames given with the
121.Fl M
122.Fl S
123and
124.Fl B
125must be full; i.e. they must begin with a
126.Ql \&/ .
127.Sh HISTORY
128The
129.Nm
130command appeared in
131.Bx 3.0 .