The which
command is used to identify the location of a given executable file that would be executed when typing the executable file name or command at the terminal prompt. This command searches for the specified executable file in the directories listed in the PATH
environment variable.
--version, -[vV]
: Output version information.--help
: Output help information.--skip-dot
: Skip directories in PATH
that start with .
.--skip-tilde
: Skip directories in PATH
that start with ~
.--show-dot
: Do not expand .
in the output to the current directory.--show-tilde
: Output a tilde for non-root users' HOME
directory.--tty-only
: Stop processing the right side of the options if not on a tty
.--all, -a
: Print all matching items in the PATH
, not just the first one.--read-alias, -i
: Read alias list from standard input.--skip-alias
: Ignore the --read-alias
option and do not read from standard input.--read-functions
: Read shell functions from standard input.--skip-functions
: Ignore the --read-functions
option and do not read from standard input.View the absolute path of the bash
command.
View the absolute path of multiple commands.
Output the absolute paths of all matching items in the environment variables.