Linux which command
This page covers the Linux version of which.
which returns the pathnames of the files (or links) which would be executed in the current environment, had the filename (or filenames) been given as a command (or commands) in a strictly POSIX-conformant shell. It does this by searching the paths in the PATH environment variable for executable files matching the names of the arguments.
which does not follow symbolic links.
which -a [filename] ...
|Print all matching pathnames of each matching filename.
which returns the following value, depending on what occurred:
|All filenames were found, and all were executable.
|One or more filenames were not found, or were not executable.
|An invalid option was specified.
Locates the pathname of the file which would run if the sh command were executed. On most systems, this will output: