I just have installed CMAKE in my ubuntu machine.. So when I do whereis cmake, it gives me the actual path

username@phx7b02c-ee1b:~/CMAKE/cmake-2.8.11$ whereis cmake
cmake: /usr/bin/cmake

But whenever I try to get the version of cmake, I always get the below message.. I am not sure what wrong I am doing here?

username@phx7b02c-ee1b:~/CMAKE/cmake-2.8.11$ /usr/bin/cmake --version
-bash: /usr/bin/cmake: is a directory

Can anyone help me here?

1 Answer 1


Try the command type instead of whereis for locating executables.

$ type -a cmake
cmake is /usr/bin/cmake

$ /usr/bin/cmake --version
cmake version 2.8.4

The command whereis doesn't use your current environment, it looks in several locations that are typically used for executables, such as:

excerpt from whereis man page



  • While this is good, he specified the full path to the binary in his example, which could not be a function or alias.
    – jordanm
    Oct 11, 2013 at 20:27
  • @jordanm - I want to see the output of type before we go any further with this. Something strange is up! I can think of several reasons that whereis would report as it did and mislead one to think the executable is /usr/bin/cmake when there is an actual directory there.
    – slm
    Oct 11, 2013 at 20:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.