I have symlinks pointing to applications placed in /usr/local/bin which is in the path. However, I can't run these applications from other folders.

Even more weird, I can't access them by the full path to the symlink.

[mqudsi@iqudsi:Desktop/EasyBCD]$ echo $path                       (03-26 13:42)
/opt/local/bin /opt/local/sbin /usr/local/bin /usr/local/sbin/ /usr/local/CrossPack-AVR/bin /usr/bin /bin /usr/sbin /sbin /usr/local/bin /usr/X11/bin

[mqudsi@iqudsi:local/bin]$ ls -l /usr/local/bin                   (03-26 13:47)
total 24280
-rwxr-xr-x  1 mqudsi  wheel    18464 May 14  2009 ascii-xfr
-rwxr-xr-x  1 mqudsi  wheel    12567 Mar 25 04:50 brew
-rwxr-xr-x  1 mqudsi  wheel    17768 Dec 11 12:41 bsdiff
-rwxr-xr-x  1 mqudsi  wheel    43024 Mar 28  2009 dumpsexp
-rwxr-xr-x  1 mqudsi  wheel      280 Sep 10  2009 easy_install
-rwxr-xr-x  1 mqudsi  wheel      288 Sep 10  2009 easy_install-2.6
-rwxr-xr-x  1 mqudsi  wheel    39696 Apr  5  2009 fuse_wait
lrwxr-xr-x  1 mqudsi  wheel       29 Mar 25 04:53 git -> ../Cellar/git/

[mqudsi@iqudsi:local/bin]$ /usr/local/bin/git                     (03-26 13:47)
zsh: no such file or directory: /usr/local/bin/git

Clearly the link is there, but I'm not able to get it to it :S

  • Can you run any of the other, non-linked, apps in /usr/local/bin, either via 'path' or by specifying their full path, or are only symlinked apps affected? What about in the parent, grandparent, ..., directories? – JRobert Mar 26 '10 at 18:05
  • 2
    The symlink exists, but does /usr/local/Cellar/git/ exist? What is the output of file /usr/local/bin/git? – coneslayer Mar 26 '10 at 18:12
  • coneslayer, with the file command I realized the symlink was broken. I had expected that using a broken symlink would display an error if that had been the case, but I guess not. Can you please post your comment as an answer below so that I can accept it? Thanks for setting me on the right track. – Mahmoud Al-Qudsi Mar 26 '10 at 18:41

[Reposted from comment at OP's request]

The symlink exists, but does /usr/local/Cellar/git/ whatever exist? What is the output of file /usr/local/bin/git?

  • BTW, one reason that I phrased these as diagnostic questions is that if the thing you're trying to run is a script that starts with "#!", you can get the same error message due to the interpreter on the "#!" line not existing. – coneslayer Mar 26 '10 at 18:46

I noticed your symlink is a relative path. That should be an absolute.

  • Relative links should work, and have the advantage that they will continue to work if that part of the directory tree is moved somewhere else. – coneslayer Mar 26 '10 at 18:25

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.