How do I add ~/bin to my path?

前端 未结 13 979
太阳男子
太阳男子 2020-12-22 19:30

I\'ve been having trouble modifying my path to add Sublime Text 2. I\'ve added a ~/bin directory and run this command:

ln -s \"/Applications/Sub         


        
13条回答
  •  旧巷少年郎
    2020-12-22 19:32

    Update for zsh For some reason, "~/bin" in my path wasn't working when I recently switched from bash to zsh/prezto. I changed it to "/Users/myusername/bin" and it works fine once again. I'll be looking for a reason why and update when I find it. Please comment if you have a better solution.

    I know this is an old post, but thought I'd document a solution for anyone else trying to follow the instructions given by sublimetext for working with sublime from the OSX command line verbatim. Update for Sublime text 3 Sublime Text 3 Documentation

    1) Create a directory called "bin" in your home directory "~/"

    mkdir ~/bin
    

    2) Create a symbolic link to your sublime text 2 app in the new directory you just created

    ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl
    

    Update for Sublime Text 3 app path is slightly different:

    ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" ~/bin/subl
    

    3) Follow Ryan Hoffman's instructions on how to easily add to the path in OSX: add to the path on Mac OSX Add the newly created "~/bin" to the path using his technique. Your /etc/paths file will look something like this when you're done (notice ~/bin at the end):

    /usr/bin
    /bin
    /usr/sbin
    /sbin
    /usr/local/bin
    ~/bin
    

    4) Open a new terminal window to start using subl from the command line.

提交回复
热议问题