Using the which command is simple. The basic usage is:
which COMMAND
Where COMMAND is the actual command you are searching for.
Let's say you need to know where the aterm executable command is. To find this you would issue:
which aterm
This command should return:
/usr/bin/aterm
Only if you have installed aterm in a different location (such as /usr/local/bin) will the output of the above command vary.
Of course which does have a few arguments to use to make it even more helpful. Let's take a look at the more useful arguments.
- a - This prints out all matches, not just the first.
- i - This will include any user-created aliases found in your .bashrc file.
- --skip-alias - This will skip your aliases. This is built into the default command.
- --skip-dot - This will skip any directory that is hidden (starts with a ".").
- --skip-tilde - This will skip any directory that starts with a "~".