Monday, 29 January 2018

Linux from the command line - finding things with 'whereis'

Linux from the command line - finding things with 'whereis'

While the 'whereis' command is handy, it is more handy when combined with the 'which' command. 'which' will tell you which binary will be run if you type that command. For example, try "which find" to see which find command will be run if you run it from your current shell and path.
https://www.howtoforge.com/linux-whereis-command/

4 comments:

  1. Actually, "which" starts a new shell, so it might disagree with your current shell. Use "type" or "command -V" to get the truth.

    ReplyDelete
  2. Adrian Colley AFAIK that's only an issue when using it in a script.

    ReplyDelete
  3. Christopher Gaul Or when you've changed your path variable or set an alias, for instance by using rvm.

    ReplyDelete
  4. Adrian Colley well, I don't think I've ever used it in any of those circumstances.

    ReplyDelete