2.21 / March 20, 2015
|Operating system||Unix, Unix-like, Microsoft Windows|
|License||GNU GPL v3|
2.1 / March 20, 2002
|License||GNU GPL v2|
|Website||Trane's World: Reinvented|
|Operating system||AROS Research Operating System|
|License||AROS Public License (APL) Version 1.1 (based on the MPL)|
which is a command for various operating systems used to identify the location of executables. The command is available in Unix and Unix-like systems, the AROS shell, for FreeDOS and for Microsoft Windows. The functionality of the which command is similar to some implementations of the type command. POSIX specifies a command named command that also covers this functionality.
The command takes one or more arguments; for each of these arguments, it prints the full path of the executable to stdout that would have been executed if this argument had been entered into the shell. It does this by searching for an executable or script in the directories listed in the environment variable PATH. The which command is part of most Unix-like computers. It is also part of the C Shell.
Microsoft Windows, MS-DOS, FreeDOS
The command is available as a separate package for Microsoft Windows as part of the GnuWin32 project and the UnxUtils collection of native Win32 ports of common GNU Unix-like utilities. Windows also includes the similar
AROS Research Operating System
The command is used to find and print the location of a specific program.
- FILE – Specifies the command to search for
- NORES – Resident programs are not included in the search
- RES – Only resident programs are considered
- ALL – Will find all locations of the FILE which may cause the printing of the same location several times
whichfor Windows from the GnuWin32 project
- "Command", The Open group base specification, Issue 7, IEEE std 1003.1-2008