Skip to content
shellmap

whereisLocate 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.

Zshunix
whereis ls

Same external `whereis` binary; zsh has no shell-builtin equivalent.

Fishunix
whereis ls

External binary; works identically to bash/zsh.

PowerShellwindows
Get-Command ls -All | Select-Object Source, CommandType

No native `whereis` equivalent. `Get-Command -All` returns every PATH match; for documentation use `Get-Help <cmdlet>` separately.

cmd.exewindows
where ls

No `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 gcc
PowerShell
Get-Command gcc -All; Get-Help gcc

Restrict the search to the binary path only

Bash
whereis -b gcc
PowerShell
(Get-Command gcc).Source
cmd.exe
where gcc

Find every man page across the configured manpath

Bash
whereis -m gcc

Gotchas

  • `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.

Related commands