What is the function of the ‘which’ command in Linux?
In Linux, the which command is used to locate and display the full path of a given command. It determines the location of the command by searching through the directories listed in the system’s PATH environment variable. When a command is typed in the terminal, the which command can help us determine which file the command is executable from in the system. This is very useful for identifying if there are multiple versions of a command in the system, checking if a command is installed, or locating if a command is in the PATH.