whereis
Explanation
The whereis command locates the binary, source, and manual page files for a command. It is more specialized than locate or find as it specifically searches in standard Linux directories for these three types of files associated with a given program name.
Basic Syntax
whereis [options] [-BMS directory... -f] name...
Common Flags and Options
| Flag | Description |
|---|---|
-b | Search for binaries only. |
-m | Search for manuals only. |
-s | Search for sources only. |
Real-world Examples
-
Find the binary, source, and man pages for
bash:whereis bash(Output might look like:
bash: /bin/bash /etc/bash.bashrc /usr/share/man/man1/bash.1.gz) -
Find only the binary for
python:whereis -b python -
Find only the manual page for
ls:whereis -m ls