whereis(1)
Locate the binary, source, and manual page files for a command.
Synopsis
whereis [OPTION]... [FILE]...Description
whereis searches for the specified command by looking in a list of standard system directories. It locates binaries, source code, and manual page entries, which is useful for finding where a program is installed or whether documentation exists.
Unlike which, whereis searches a predefined set of directories rather than the PATH variable, making it faster and more thorough for discovering all instances of a command on the system.
Common options
| Flag | What it does |
|---|---|
-b | Search only for binaries |
-m | Search only for manual pages |
-s | Search only for source files |
-u | Search for unusual entries (files not matching standard patterns) |
-B PATH | Specify directories to search for binaries |
-M PATH | Specify directories to search for manual pages |
-S PATH | Specify directories to search for source files |
-l | List search paths (show default directories used) |
Examples
Find binary, source, and man page for the ls command
whereis lsFind only the binary location of grep
whereis -b grepFind only the manual page for bash
whereis -m bashFind only source files for gcc (if available)
whereis -s gccDisplay the default search paths used by whereis
whereis -lSearch for ssh binary in /usr/bin and manual pages in default locations
whereis -B /usr/bin -m ssh