whereis — Locate the binary, source, and manual page for a command across all 5 shells
Equivalents in every shell
Bashunix
whereis ls`whereis` is a Linux/BSD utility that reports the binary, source, and man-page locations for a command — broader than `which`, which returns only the binary path.
PowerShellwindows
Get-Command ls -All | Select-Object Source, CommandTypeNo native `whereis` equivalent. `Get-Command -All` returns every PATH match; for documentation use `Get-Help <cmdlet>` separately.
cmd.exewindows
where lsNo `whereis`. `where` only returns binary paths — no source or man-page lookup.
Worked examples
Locate the gcc binary plus its source and manual pages
Bash
whereis gccPowerShell
Get-Command gcc -All; Get-Help gccRestrict the search to the binary path only
Bash
whereis -b gccPowerShell
(Get-Command gcc).Sourcecmd.exe
where gccFind every man page across the configured manpath
Bash
whereis -m gccGotchas
- `whereis` is Linux/BSD-only — there is no native Windows equivalent. The closest Windows answers (`Get-Command -All`, `where`) only resolve executables, not documentation.
- Default `whereis` only searches the *standard* directories (`/usr/bin`, `/usr/local/bin`, `/usr/share/man`, etc.). It misses binaries installed in `~/.local/bin` or `~/bin` unless you pass `-B` / `-M` / `-S` explicitly.
- On macOS, `whereis` is a stripped-down BSD build. The `-b` / `-m` / `-s` flags work, but the default search paths differ from Linux. Most Homebrew-installed binaries are NOT found.
- `whereis` matches the basename exactly — it does NOT recurse like `which -a`. To find every `python*` in PATH, prefer `compgen -c python` (bash) or `ls -1 $(echo $PATH | tr ':' '\n')/python* 2>/dev/null`.
WSL & PowerShell Core notes
pwshPowerShell Core ships no `whereis`-style cmdlet. The conventional substitute is three separate calls: `Get-Command <name> -All` for the binary, `Get-Help <name>` for docs, `Get-Module <name>` for module source.
WSLWSL `whereis` works exactly as on native Linux. It does NOT see Windows binaries on `%PATH%`; reach those via `where.exe <name>` interop.