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

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

  1. gguerini macrumors regular

    gguerini

    Joined:
    Jun 28, 2007
    #1
    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:

    Code:
    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!

    Guillermo
     
  2. gguerini thread starter macrumors regular

    gguerini

    Joined:
    Jun 28, 2007
    #2
    Fixed:

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

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

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

    Joined:
    Dec 25, 2009
    #4
    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