whereis Linux Command
Locates the binary, source, and manual page files for a command.
What does whereis do?
Locates the binary, source, and manual page files for a command.
Syntax
whereis commandPractical example
whereis nmapQuestions about whereis
How do I find binary, source, and man pages?
Use `whereis commandname` to see the binary path, source files, and manual page location for a command.
How do I find only the binary path?
Use `whereis -b commandname` to show only the binary executable location without source or man pages.
How do I find only man pages?
Use `whereis -m commandname` to show only the manual page location.
How do I find only source files?
Use `whereis -s commandname` to show only the source file locations.
What is the difference between which and whereis?
`which` shows only the executable path from PATH. `whereis` shows binary, source, and man page locations in standard directories.
How do I see all locations for a command?
Use `whereis commandname` which shows all locations. Use `-u` to show only entries that are unusual (not in standard locations).
How do I find where nginx is installed?
Use `whereis nginx` to see the binary, config files, and man page locations for nginx.
How do I search for a command in specific directories?
Use `whereis -f -M /path/to/dir commandname` to search only in specific directories.
Related Search Commands
whichShows the full path of the executable that would run for a given command.
typeDisplays how a command name would be interpreted (alias, builtin, external, etc.).
locateQuickly finds files by name using a pre-built database (run updatedb to refresh).
awkPowerful text processing language for pattern scanning and data extraction.
grepSearches for patterns (text or regex) inside files and prints matching lines.
sedStream editor for filtering and transforming text (find/replace, insert, delete).