WHEREIS(1)

NAME
whereis - locate programs

SYNOPSIS
whereis [-bms] [-u] [-BMS -dir -... -f] program ...

DESCRIPTION
The whereis utility checks the standard binary, manual page, and source directories for the specified programs, printing out the paths of any it finds. The supplied names are first stripped of leading path name components, any single trailing extension of the form ‘.ext’, and the leading ‘s.’ or trailing ‘,v’ from a source code control system.

The default path searched is the string returned by the sysctl(8) utility for the “user.cs_path” string, with /usr/libexec and the current user's $PATH appended. Manual pages are searched by default along the $MANPATH. Program sources are located in a list of known standard places, including all the subdirectories of /usr/src and /usr/ports.

The following options are available:

-B  Specify directories to search for binaries. Requires the -f option.

-M  Specify directories to search for manual pages. Requires the -f option.

-S  Specify directories to search for program sources. Requires the -f option.

-b  Search for binaries.

-f  Delimits the list of directories after the -B, -M, or -S options, and indicates the beginning of the name list.

-m  Search for manual pages.

-s  Search for source directories.

-u  Search for “unusual” entries. A file is said to be unusual if it does not have one entry of each requested type.

EXAMPLE
The following finds all utilities under /usr/bin that do not have documentation:
    whereis -m -u /usr/bin/*

SEE ALSO
locate(1), man(1), sysctl(8)

BUGS
The search for sources is implemented as a quick search as the first-level subdirectory of each element of the list of source directories first. If this didn't succeed, the utility locate(1) is requested to do the search in deeper nested subdirectories. This might take some time, and will only succeed if the locate database is up-to-date.

HISTORY
The whereis command appeared in 3.0BSD. This version re-implements the historical functionality that was lost in 4.4BSD.