Locate binary, source, and man page for a command.
low risk
whereis locates binary, source code, and manual page files for a given command, searching standard system directories (not just PATH). More comprehensive than which but less precise for custom installations.
| Flag | Meaning |
|---|---|
-b --binary | Search for binary only |
-m --manual | Search for man pages only |
-s --source | Search for source only |
whereis bashFind bash binary, source, and man page · explain & risk-check →whereis -b nginxFind only the nginx binary · explain & risk-check →whereis -m systemctlFind the systemctl man page location · explain & risk-check →Use `whereis -b cmd` in automation scripts to check if a binary exists before using it — more reliable than `which` across different distros.
Reference text is hand-written and may be incomplete — check man whereis for your version. Test destructive commands on a non-production system first.