What is the purpose of the 'which' command?

The which command is used in Unix-like operating systems to locate the executable file associated with a given command. It searches the directories listed in the user's PATH environment variable and returns the path of the executable that would have been executed if the command had been entered in the terminal.

For example, running:

which python

will return the path to the Python executable if it is installed and available in the PATH.

0 Comments

no data
Be the first to share your comment!