shows the full path of (shell) commands
References
man which
-a, --all
Print all matching executables in PATH, not just the first-i, --read-alias
Read aliases (default)--skip-alias
Ignore option--read-alias
, if any.--read-functions
Read shell function definitions from stdin, reporting matching ones on stdout--skip-functions
Ignore option--read-functions
, if any.- ……
Print the first matching executable
which <command_name>
# e.g.
$ which bash
/bin/bash
Print all matching executables
$ which -a bash
/bin/bash
/usr/bin/bash
On BSD, builtin where
== which -a
$ where php
/usr/local/bin/php
/usr/bin/php
$ which php
/usr/local/bin/php
/usr/bin/php