Go2Linux | Linux Operating System

A site dedicated to: Linux Operating System

small tip - Find where in Path a command is located - which

Date: 2009-04-06 00:00:00 -0400

If for any reason you need to find where in the disk a command, you may use which this command will search on the PATH and display the directory where the command is located.

You may also look for a list of commands instead of a simple command, lets see some examples:

which ls

The output is:

/bin/ls

Now if you run:

which opera

This is the output in my PC, where I have opera installed.

/usr/bin/opera

But, you can also run which to look for a list of commands as I said before.

which ls opera

This might be the output:

/bin/ls
/usr/bin/opera

For more information, see the man pages.

If you liked this article please share it.

powered by TinyLetter

If you want to contact me in any other way, please use the contact page.