xref: /csrg-svn/old/whereis/whereis.1 (revision 48599)
1*48599Scael.\" Copyright (c) 1980, 1990 The Regents of the University of California.
240378Sbostic.\" All rights reserved.
319349Smckusick.\"
448331Sbostic.\" %sccs.include.redist.roff%
519349Smckusick.\"
6*48599Scael.\"     @(#)whereis.1	6.5 (Berkeley) 04/23/91
740378Sbostic.\"
8*48599Scael.Dd
9*48599Scael.Dt WHEREIS 1
10*48599Scael.Os BSD 3
11*48599Scael.Sh NAME
12*48599Scael.Nm whereis
13*48599Scael.Nd locate binary, manual, and or source for program
14*48599Scael.Sh SYNOPSIS
15*48599Scael.Nm whereis
16*48599Scael.Op Fl bms
17*48599Scael.Op Fl u
18*48599Scael.Op Fl BMS Ar dir Ar ... Fl f
19*48599Scael.Ar name Ar ...
20*48599Scael.Sh DESCRIPTION
21*48599Scael.Nm Whereis
2219349Smckusicklocates source/binary and manuals sections for specified files.
2319349SmckusickThe supplied names are first stripped of leading pathname components
24*48599Scaeland of any (single) trailing extension of the form
25*48599Scael.Ql .ext ,
26*48599Scaele.g.
27*48599Scael.Ql \&.c .
28*48599ScaelPrefixes of
29*48599Scael.Ql \&.s
30*48599Scaelresulting from use of source code control are also
3119349Smckusickdealt with.
32*48599Scael.Nm Whereis
3319349Smckusickthen attempts to locate the desired program in a list of standard places.
34*48599Scael.Pp
35*48599ScaelAvailable options:
36*48599Scael.Bl -tag -width Ds
37*48599Scael.It Fl B
38*48599ScaelChange or limit directories searched for binaries. Requires the
39*48599Scael.Fl f
40*48599Scaelflag.
41*48599Scael.It Fl M
42*48599ScaelChange or limit directories searched for manual entries. Requires the
43*48599Scael.Fl f
44*48599Scaelflag.
45*48599Scael.It Fl S
46*48599ScaelChange or limit directories searched for source. Requires the
47*48599Scael.Fl f
48*48599Scaelflag.
49*48599Scael.It Fl b
50*48599ScaelSearch for binaries.
51*48599Scael.It Fl f
52*48599ScaelSignals the end of a directory list specified by one or more of the
53*48599Scael.Fl B , M
5419349Smckusickor
55*48599Scael.Fl S
56*48599Scaeloptions and the start of file
57*48599Scael.Ar names .
58*48599Scael.It Fl m
59*48599ScaelSearch for manual entries.
60*48599Scael.It Fl s
61*48599ScaelSearch for source.
62*48599Scael.It Fl u
63*48599ScaelSearch for unusual entries.
6419349SmckusickA file is said to be unusual if it does not have one entry of
6519349Smckusickeach requested type.
66*48599ScaelThus:
67*48599Scael.Pp
68*48599Scael.Dl whereis -m -u *
69*48599Scael.Pp
70*48599Scaelasks for those files in the current
7119349Smckusickdirectory which have no documentation.
72*48599Scael.El
73*48599Scael.Sh EXAMPLE
74*48599ScaelThe following finds all the files in
75*48599Scael.Pa /usr/bin
76*48599Scaelwhich are not documented
77*48599Scaelin
78*48599Scael.Pa /usr/share/man/man1
79*48599Scaelwith source in
80*48599Scael.Pa /usr/src/cmd:
81*48599Scael.Bd -literal -offset indent -compact
8219349Smckusickcd /usr/ucb
83*48599Scaelwhereis \-u \-M /usr/share/man/man1 \-S /usr/src/cmd \-f *
84*48599Scael.Ed
85*48599Scael.Sh FILES
86*48599Scael.Bl -tag -width /lib,x/etc,x/usr/{lib,bin,ucb,old,new,local} -compact
87*48599Scael.It Pa /usr/src/*
88*48599Scael.It Pa /usr/{doc,man}/*
89*48599Scael.It Pa /lib, /etc, /usr/{lib,bin,ucb,old,new,local}
90*48599Scael.El
91*48599Scael.Sh BUGS
9219349SmckusickSince the program uses
93*48599Scael.Xr chdir 2
9419349Smckusickto run faster, pathnames given with the
95*48599Scael.Fl M
96*48599Scael.Fl S
9719349Smckusickand
98*48599Scael.Fl B
99*48599Scaelmust be full; i.e. they must begin with a
100*48599Scael.Ql \&/ .
101*48599Scael.Sh HISTORY
102*48599ScaelThe
103*48599Scael.Nm
104*48599Scaelcommand appeared in
105*48599Scael.Bx 3.0 .
106