How do I add ~/bin to my path? How do I add ~/bin to my path? bash bash

How do I add ~/bin to my path?


I was just as new to this as you, which means I wasn't even sure how to read half the stuff related to modifying PATH. Eventually though I came upon a way to do it that doesn't require you to put subl into the .rvm/bin (since that is for something else) but in its appropriate directory, which is ~/bin.

Go to your terminal and type:

open -a Finder /usr/bin

This will open your Finder to the /usr/bin directory. Once you're there open a new Finder, go to Applications, right click on the Sublime Text icon and go to Show Package Contents, then to Contents, SharedSupport, bin. Copy the subl file and paste it into the other Finder showing /usr/bin

That's it! You should be set to use the command:

subl . (or subl file.name)


Instread of all commented here. You need add symlink to sublime in /usr/local/bin. Its not require a root access. And don't need to create another bin directory.

For Sublime Text 2

ln -s /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl /usr/local/bin/

For Sublime Text 3

ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/


Update for zshFor 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.