Go to the first, previous, next, last section, table of contents.


11 Locate command

The Whereis program locates source/binary and manuals sections for specified files. The supplied names are first stripped of leading pathname components and of any (single) trailing extension of the form `.ext', e.g. `.c'. Prefixes of `s.' resulting from use of source code control are also dealt with. Whereis then attempts to locate the desired program in a list of standard places.

For the future, it is planned to rewrite whereis to support long options and database lookup.

11.1 whereis options

Available options:

`-b'
Search for binaries.
`-f'
Signals the end of a directory list specified by one or more of the `-B', `-M' or `-S' options and the start of file names.
`-m'
Search for manual entries.
`-s'
Search for source.
`-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'
Change or limit directories searched for binaries. Requires the `-f' flag.
`-M'
Change or limit directories searched for manual entries. Requires the `-f' flag.
`-S'
Change or limit directories searched for source. Requires the `-f' flag.

11.2 whereis invocation

Synopsis:

$ whereis [OPTIONS]... [KEYWORD]...

The following finds all the files in `/usr/bin' which are not documented in `/usr/share/man/man1' with source in `/usr/src/cmd':

whereis -u -M /usr/share/man/man1 -S /usr/src/cmd -f *


Go to the first, previous, next, last section, table of contents.