Search code examples
oh-my-zshzshrc

On my mac. whereis command failed return application path


All

  1. my shell is oh-my-zsh.
  2. “whereis” doesn't work, there is not any response while I'v executed the command.
  3. “which” works normally.

Here are some details

~ ⌚ 3:26:26
$ echo $PATH      ‹ruby-2.2.4›
/Users/luoweiguang/.rvm/gems/ruby-2.2.4/bin:/Users/luoweiguang/.rvm/gems/ruby-2.2.4@global/bin:/Users/luoweiguang/.rvm/rubies/ruby-2.2.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Wireshark.app/Contents/MacOS:/Users/luoweiguang/.rvm/bin

~ ⌚ 3:26:28
$ which man      ‹ruby-2.2.4›
/usr/bin/man

~ ⌚ 3:26:36
$ whereis Notes      ‹ruby-2.2.4›

~ ⌚ 3:26:49
$ whereis XCode      ‹ruby-2.2.4›

~ ⌚ 3:41:35
$

I spent much time on the problem for these days. and I didn't find a way to fix it, Hope you guys can help me. Thanks


Solution

  • whereis probably works just fine, there are just no binaries named Notes or XCode in your $PATH. For confirmation, please try to run which Notes and which XCode. Also try whereis man to confirm that whereis is actually working.

    XCode and Notes come as App bundle and their executables are not placed in the "normal" places like /usr/bin. Instead their executable is inside their bundle directory, which (or rather the appropriate subdirectory) is usually not part of $PATH. For Notes this the bundle directory is /Applications/Notes.app and the executable is /Applications/Notes.app/Contents/MacOS/Notes.