which (Unix)

From Wikipedia, the free encyclopedia
Jump to: navigation, search

which is a Unix command used to identify the location of executables.

The command takes one or more arguments; for each of these arguments, it prints to stdout the full path of the executable 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.[1] The which command is part of most Unix-like computers; and is also available as a separate package for Microsoft Windows.[2]

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.[3]

[edit] References

  1. ^ which man page
  2. ^ which for Windows from the GnuWin32 project
  3. ^ "Command", The Open group base specification, Issue 7, IEEE std 1003.1-2008, http://pubs.opengroup.org/onlinepubs/9699919799/utilities/command.html 

[edit] External links

Personal tools
Namespaces

Variants
Actions
Navigation
Interaction
Toolbox
Print/export
Languages