which command alternatives in Windows

Which command is a useful tool in Linux. If you run a command by just typing its name instead of the full path name, the shell will find the command in the directories specified in the $PATH environment variable and execute the first command it finds. This is convenient in most cases since it relieves you of typing the full path name of the command. But in some cases, it may cause problem. For example, there are multiple commands with the same name, and they are put in different directories. If you do not type the full path name of the command, the shell may execute a command that is not what you want. In this case, you can use the which or where command to check if the command to be executed is exactly what you want. Which command does the same thing as what the shell does during finding the command to executed, but instead of running the command, which command just prints the full path name of the command.

To view this content, you must be a member of Thomas's Patreon at $5 or more
Already a qualifying Patreon member? Refresh to access this content.
Posted in

Leave a Reply