whereis Command
Beginner File Viewing & Searching man(1)Locate the binary, source, and manual page files for a command
👁 11 views
📅 Updated: Mar 15, 2026
SYNTAX
whereis [OPTION] NAME
What Does whereis Do?
The whereis command locates binary, source, and manual page files for a command. Unlike which (which only searches PATH), whereis searches standard system directories for all components of a program.
whereis looks in directories like /usr/bin, /usr/sbin, /usr/share/man, and other standard locations. It finds not just the executable but also documentation and source files.
This command is useful for finding all installed components of a program, locating man pages, and discovering if source code is available on the system.
whereis looks in directories like /usr/bin, /usr/sbin, /usr/share/man, and other standard locations. It finds not just the executable but also documentation and source files.
This command is useful for finding all installed components of a program, locating man pages, and discovering if source code is available on the system.
Options & Flags
| Option | Description | Example |
|---|---|---|
| -b | Search only for binaries | whereis -b nginx |
| -m | Search only for man pages | whereis -m grep |
| -s | Search only for source files | whereis -s gcc |
| -u | Find commands with unusual (missing) entries | whereis -u -m * |
| -B | Define binary search path | whereis -B /opt/custom/bin -f myapp |
| -l | List directories that will be searched | whereis -l |
Practical Examples
#1 Find all components
Shows binary, man page, and config file locations.
$ whereis nginx
Output:
nginx: /usr/sbin/nginx /usr/share/nginx /usr/share/man/man8/nginx.8.gz
#2 Find binary only
Shows only the executable location.
$ whereis -b python3
Output:
python3: /usr/bin/python3
#3 Find man pages
Shows only the manual page locations.
$ whereis -m awk
Output:
awk: /usr/share/man/man1/awk.1.gz
#4 List search directories
Lists all directories that whereis will search.
$ whereis -l#5 Check multiple commands
Shows binary, source, and man page locations for each command.
$ whereis gcc make cmake#6 Find commands missing man pages
Lists commands in /usr/bin that have no man page.
$ whereis -u -m /usr/bin/*Tips & Best Practices
whereis vs which: which searches PATH and finds only executables. whereis searches standard directories and finds binaries, man pages, and source files.
Quick documentation check: Use whereis -m command to quickly check if man pages exist for a command before trying to read them.
Standard locations only: whereis only searches standard system directories. It may miss programs installed in non-standard locations like /opt or ~/.local/bin.
Frequently Asked Questions
What is the difference between which and whereis?
which finds the executable in your PATH. whereis finds binaries, man pages, and source files in standard system directories.
How do I find the man page for a command?
Use whereis -m command_name. It shows all man page files for that command across all sections.
Why does whereis show fewer results than find?
whereis only searches standard system directories (/usr/bin, /usr/share/man, etc.). Use find for comprehensive filesystem-wide searching.
Related Commands
More File Viewing & Searching Commands
Master Linux with Professional eBooks
Curated IT eBooks covering Linux, DevOps, Cloud, and more
Browse Books →