Locates source, binary, or manual for program.
whereis [ -s ] [ -b ] [ -m ] [ -u ] [ { { -S | -B | -M } Directory ... }... -f ] File ...
The whereis command locates the source, binary, and manuals sections for specified files. The supplied names are first stripped of leading path name components and any (single) trailing extension of the form .ext (for example, .c). Prefixes of s. resulting from use of the Source Code Control System (see SCCS) are also dealt with. The command then attempts to find the desired program from a list of standard locations.
A usage message is returned if a bad option is entered. In other cases, no diagnostics are provided.
If any of the -b,
-s, -m or -u flags are given, the
whereis command searches only for binary, source, manual, or
unusual sections respectively (or any two thereof).
The -B, -M, and
-S flags can be used to change or otherwise limit the places where
the whereis command searches. Since the program uses the
chdir subroutine to run faster, path names given with the -M,
-S and -B flag directory list must be full; for example,
they must begin with a / (slash).
To find all of the files in the /usr/ucb directory that either are not documented in the /usr/man/man1 directory or do not have source in the /usr/src/cmd directory, enter:
cd /usr/ucb whereis -u -M /usr/man/man1 -S /usr/src/cmd -f *
/usr/share/man/* | Directories containing manual files. |
/sbin, /etc, /usr/{lib,bin,ucb,lpp} | |
Directories containing binary files. | |
/usr/src/* | Directories containing source code files. |
The chdir subroutine.