1.\" Copyright (c) 1980, 1990 The Regents of the University of California. 2.\" All rights reserved. 3.\" 4.\" %sccs.include.redist.roff% 5.\" 6.\" @(#)whereis.1 6.5 (Berkeley) 04/23/91 7.\" 8.Dd 9.Dt WHEREIS 1 10.Os BSD 3 11.Sh NAME 12.Nm whereis 13.Nd locate binary, manual, and or source for program 14.Sh SYNOPSIS 15.Nm whereis 16.Op Fl bms 17.Op Fl u 18.Op Fl BMS Ar dir Ar ... Fl f 19.Ar name Ar ... 20.Sh DESCRIPTION 21.Nm Whereis 22locates source/binary and manuals sections for specified files. 23The supplied names are first stripped of leading pathname components 24and of any (single) trailing extension of the form 25.Ql .ext , 26e.g. 27.Ql \&.c . 28Prefixes of 29.Ql \&.s 30resulting from use of source code control are also 31dealt with. 32.Nm Whereis 33then attempts to locate the desired program in a list of standard places. 34.Pp 35Available options: 36.Bl -tag -width Ds 37.It Fl B 38Change or limit directories searched for binaries. Requires the 39.Fl f 40flag. 41.It Fl M 42Change or limit directories searched for manual entries. Requires the 43.Fl f 44flag. 45.It Fl S 46Change or limit directories searched for source. Requires the 47.Fl f 48flag. 49.It Fl b 50Search for binaries. 51.It Fl f 52Signals the end of a directory list specified by one or more of the 53.Fl B , M 54or 55.Fl S 56options and the start of file 57.Ar names . 58.It Fl m 59Search for manual entries. 60.It Fl s 61Search for source. 62.It Fl u 63Search for unusual entries. 64A file is said to be unusual if it does not have one entry of 65each requested type. 66Thus: 67.Pp 68.Dl whereis -m -u * 69.Pp 70asks for those files in the current 71directory which have no documentation. 72.El 73.Sh EXAMPLE 74The following finds all the files in 75.Pa /usr/bin 76which are not documented 77in 78.Pa /usr/share/man/man1 79with source in 80.Pa /usr/src/cmd: 81.Bd -literal -offset indent -compact 82cd /usr/ucb 83whereis \-u \-M /usr/share/man/man1 \-S /usr/src/cmd \-f * 84.Ed 85.Sh FILES 86.Bl -tag -width /lib,x/etc,x/usr/{lib,bin,ucb,old,new,local} -compact 87.It Pa /usr/src/* 88.It Pa /usr/{doc,man}/* 89.It Pa /lib, /etc, /usr/{lib,bin,ucb,old,new,local} 90.El 91.Sh BUGS 92Since the program uses 93.Xr chdir 2 94to run faster, pathnames given with the 95.Fl M 96.Fl S 97and 98.Fl B 99must be full; i.e. they must begin with a 100.Ql \&/ . 101.Sh HISTORY 102The 103.Nm 104command appeared in 105.Bx 3.0 . 106