Linux console whereis VS which

In a recent incident where I was looking for Java on the console I noticed a difference between whereis and which. This is the short version:

whereis
searches the standard Linix (Unix) locations for a specified command

which
which returns the pathnames of the files which would be executed in the current environment

I prefer which because I am more interested in if a binary can be accessed in the current environment.

 

(172 Posts)

20 years of coding and working as software engineer but I am still eager to learn more. I am very passionate when it comes to open source, Linux and Java. But I made my peace with Windows long ago to fully enjoy my PC gaming hobby. I have a soft spot for 90s electronic music and Babylon 5. In the evenings you will find me roaming the endless space in Warframe (IGN k05h).

Leave a Reply

Your email address will not be published. Required fields are marked *