Locate a program file (UNIX)
which [-afLls] program...
QNX Neutrino, Microsoft Windows
The which utility searches for the specified programs. By default, which searches the directories listed by your PATH environment variable, but if you specify the -s option, it searches the directories specified by LD_LIBRARY_PATH and _CS_LIBPATH.
The Korn shell has a builtin whence command that's similar to the which utility but also tells you if the given command is a reserved word, alias, builtin command, and so on. For more information, see the entry for ksh.
Display the full pathname and long status for all versions of the ls utility found in PATH:
which -alf ls
Display the pathname for the which utility:
which which