๐ŸŽ New User? Get 20% off your first purchase with code NEWUSER20 ยท โšก Instant download ยท ๐Ÿ”’ Secure checkout Register Now โ†’
Menu

Categories

๐Ÿ’ก File Viewing & Searching August 18, 2026 7

Linux Command: whereis

Locate the binary, source, and manual page files for a command

Terminal โ€” File Viewing & Searching
Command
$ whereis nginx
Output
nginx: /usr/sbin/nginx /usr/share/nginx /usr/share/man/man8/nginx.8.gz

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.

Syntax

whereis [OPTION] NAME

Key Options

  • -b โ€” Search only for binaries
  • -m โ€” Search only for man pages
  • -s โ€” Search only for source files
  • -u โ€” Find commands with unusual (missing) entries
  • -B โ€” Define binary search path
  • -l โ€” List directories that will be searched

Examples

Find all components

whereis nginx

Output: nginx: /usr/sbin/nginx /usr/share/nginx /usr/share/man/man8/nginx.8.gz

Find binary only

whereis -b python3

Output: python3: /usr/bin/python3

Find man pages

whereis -m awk

Output: awk: /usr/share/man/man1/awk.1.gz

Pro Tips

  • which searches PATH and finds only executables. whereis searches standard directories and finds binaries, man pages, and source files.
  • Use whereis -m command to quickly check if man pages exist for a command before trying to read them.
  • whereis only searches standard system directories. It may miss programs installed in non-standard locations like /opt or ~/.local/bin.

Learn more: Full whereis reference โ†’

Share this tip