Terminal / Symlink: How to add a directory to my path?

Discussion in 'macOS' started by gguerini, Apr 4, 2012.

  1. gguerini macrumors regular


    Jun 28, 2007
    Hey guys,

    I'm trying to follow the instructions below:

    The first task is to make a symlink to subl. Assuming you've placed Sublime Text 2 in the Applications folder, and that you have a ~/bin directory in your path, you can run:

    ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl
    When I try this command it tells me it can't find the directory:
    /Users/gguerini/bin/subl: No such file or directory

    What can I do??

    Thanks a lot!

  2. gguerini thread starter macrumors regular


    Jun 28, 2007

    ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /usr/bin/subl
  3. zubintehe macrumors newbie

    Feb 18, 2013
    I'm having the same problem and am now receiving this error message:

    ln: /usr/bin/subl: Permission denied
    Any suggestions of how to fix this?
  4. dove macrumors member

    Dec 25, 2009
    Don't do that. /usr/bin is a directory for system executables.

    If you want you can do, "sudo ln -s /source/path /usr/local/bin/" (sudo will prompt you for your password).

    Alternatively you can change your path. Create a file '.profile' in your home directory and type something in it like "export PATH=/foo/bar:$PATH".


    That's not the same thing at all. "~" is short for "my home directory". The reason you got an error is because you don't have a directory "bin" in your home dir. What you did is make a symlink in a system directory. That will work but it's messy.

Share This Page