Forever & AlwaysLINUX COMMAND ATLAS

LINUX COMMAND ATLAS · COMMAND GUIDE

Linux which command

Show which executable would run when you enter a command name.

which manual

Syntax

Command form
which [-a] NAME...

Common options

4 options
OptionWhat it does
-aPrint every matching executable found in PATH.
--read-aliasRead aliases from standard input (in supported implementations).
--skip-aliasIgnore aliases (in supported implementations).
--read-functionsRead shell functions from standard input (in supported implementations).

Usage examples

2 examples

Show which executable would run when you enter a command name.

which python3

List all python3 matches in PATH.

which -a python3

Notes

which implementations differ and may not understand aliases from the current shell. In Bash, type -a is often more informative.