whereis

Locate binary, source, and man page for a command.

low risk

interactive breakdown — edit the command and press Explain
$ 
What it does

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.

Common flags
FlagMeaning
-b --binarySearch for binary only
-m --manualSearch for man pages only
-s --sourceSearch for source only
Examples
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 →
Pro tip

Use `whereis -b cmd` in automation scripts to check if a binary exists before using it — more reliable than `which` across different distros.

Related
which type locate
Open the full explainer →More in Shell & Scripting

Reference text is hand-written and may be incomplete — check man whereis for your version. Test destructive commands on a non-production system first.