which command

A shell command that shows which program a command name will run, by searching PATH the same way the shell does.

In more detail

which -a python3 lists every match in PATH order on macOS and Linux; the first one wins. On Windows, where python does the same job in Command Prompt and Get-Command python in PowerShell. It is the quickest way to see why an old or unexpected Python answers.

Example

which -a python3

Related terms

Taught in

References