.\" ENVIRONMENTS:  COHERENT3
.TH whereis "" "" Command
.PC "Locate source, binary, and manual files"
\fBwhereis [\-bmrsu] [\-BMS \fIdir ...\fB \-f] \fIname ...\fR
.PP
.HS
.SH Options:
.IC "\fB\-b\fR"
Search only for for binary files
.IC "\fB\-m\fR"
Search only for manual pages
.IC "\fB\-r\fR"
Search each \fIdir\fR downwardly recursively
.IC "\fB\-s\fR"
Search only for source files
.IC "\fB\-u\fR"
Search for unusual files
.IC "\fB\-B\fR"
Search each \fIdir\fR for binary files
.IC "\fB\-M\fR"
Search each \fIdir\fR for manual pages
.IC "\fB\-R\fR"
Search each \fIdir\fR downwardly recursively
.IC "\fB\-S\fR"
Search each \fIdir\fR for source files
.IC "\fB\-f\fR"
Terminate directory list begun by \fB\-BMRS\fR options
.HE
The command
.B whereis
locates source files, binary files (executables),
and manual pages (documentation) that match a given
.IR name .
Prior to searching,
.B whereis
strips
.I name
of any path information, extensions, and
the
.B s.
prefix.
.PP
By default,
.B whereis
searches the following directories:
.DS
.ta 1.5i 3.0i
\fISources	Binaries	Manual Pages\fR
/usr/src/cmd	/bin	/usr/man/*
/usr/src/games	/usr/bin
/usr/src/local	/usr/games
/usr/src/alien	/usr/local
/usr/include	/etc
/usr/include/sys	/lib
	/usr/lib
.DE
.SH Options
.B whereis
recognizes the following command-line options:
.RS
.IP \fB\-b\fR 0.4i
Search only for binary files.
.IP \fB\-B\fR
Use the directory list specified by
.I dir
instead of the default directory list for binary files.
.IP \fB-f\fR
Terminate the directory list introduced by options
.BR \-B ,
.BR \-M ,
or
.BR \-S ,
and treat any additional command-line arguments as file names
to be searched for.
.IP \fB\-m\fR
Search only for manual pages (documentation files).
.IP \fB\-M\fR
Use the directory list specified by
.I dir
instead of the default directory list for manual pages.
.IP \fB\-r\fR
Search recursively downward from the directories specified by
.I dir
or from the default directories.
This option is useful when the searched directories contain sub-directories.
By default,
.B whereis
searches only the directories specified or the default directories.
.IP \fB\-s\fR
Search only for source files.
.IP \fB-S\fR
Use the directory list specified by
.I dir
instead of the default directory list for source files.
.IP \fB\-u\fR
Search for \*(QLunusual\*(QR files.
A file is said to be unusual if it does not have one entry for each
of the three search categories.
.RE
.PP
Please note that if you use options
.BR \-B ,
.BR \-S ,
or
.BR \-M ,
you must use the
.B \-f
option to terminate the directory list specified by
.IR dir .
.SH Example
The following example finds all commands in directory
.B bin
that have either no corresponding source code in directory
.B src
or no corresponding documentation in directory
.BR doc :
.DM
	whereis -u -M doc -S src -B bin -f bin/*
.DE
.SH "See Also"
.Xr "commands," commands
.Xr "find," find
.Xr "qfind," qfind
.Xr "which" which
.SH Notes
.B whereis
is copyright \(co 1980,1990
by The Regents of the University of California.
All rights reserved.
.PP
.B whereis
is distributed as a service to COHERENT customers, as is.
It is not supported by Mark Williams Company.
.I "Caveat utilitor."
.\" See comment at the bottom of "cut" and "paste".
