WHEREIS(1) BSD WHEREIS(1)
NAME
whereis - locate source, binary, and/or manual for program
SYNOPSIS
whereis [ -sbm ] [ -u ] [ -SBM dir ... -f ] name ...
DESCRIPTION
whereis locates source/binary and manuals sections for specified files.
The supplied names are first stripped of leading pathname components and
any single extension consisting of a period followed by one or more
characters, e.g., .c. whereis also ignores prefixes of "s." resulting
from use of source code control (SCCS). whereis attempts to locate the
desired program in a list of standard places.
OPTIONS
The -s, -b, and -m options can be combined.
-s Search for sources.
-b Search for binaries.
-m Search for manual sections.
-u Search for unusual entries. A file is said to be unusual if it
does not have one entry of each requested type. Thus, whereis
-m -u * asks for those files in the current directory which
have no documentation.
-B dir ...
Change or otherwise limit search for binaries to the specified
directories.
-M dir ...
Change or otherwise limit search for manual sections to the
specified directories.
-S dir ...
Change or otherwise limit search for sources to the specifed
directories.
-f Terminate the last directory list and signal the start of file
names.
EXAMPLE
The following finds all the files in /usr/ucb which are not documented in
/usr/man/man1 with source in /usr/src/cmd:
cd /usr/ucb
whereis -u -M /usr/man/man1 -S /usr/src/cmd
FILES
/usr/src/*
/usr/{doc,man}/*
/lib, /etc, /usr/{lib,bin,ucb,old,new,local}
BUGS
Since the program uses chdir(2) to run faster, pathnames given with the
options -M, -S, and -B must be full, i.e., they must begin with a slash.
SEE ALSO
which(1)