Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have installed Sublime on my Mac Lion Laptop, and followed the guide here but as always it did not work. I dont have a ~/bin directory on my Mac. Any help?

share|improve this question

You could create the symlink in /usr/bin:

sudo ln -s "/Applications/Sublime Text" /usr/bin/subl
share|improve this answer

If you don't have a ~/bin directory, you can create one with mdkir ~/bin. This should allow you to follow the guide.

If you do this and Sublime is still not working for you after you've set everything up, then this new folder is probably not included in your $PATH (a list of folders that command-line shells search for executables). You can check if this is the case by running echo $PATH and see if it contains /Users/<your username>/bin. If you don't see the new folder we created in your $PATH, then you'll have to add it: Add folder to PATH

A more appropriate location to link the subl exceutable might be /usr/local/bin if it exists.

share|improve this answer
  1. Create a bin directory in your home folder using the Finder or by typing mkdir ~/bin in the terminal.

  2. Create a symlink to the subl app in that bin folder by typing sudo ln -s "/Applications/Sublime Text" ~/bin/subl in the terminal.

  3. Open or create a file called .bash_profile (note the dot!) in your home directory using Sublime Text. (Your home directory will be the one in the Finder with the home icon. You can get the Finder to show the home directory quickly by typing open ~ in the terminal.)

  4. Add the ~/bin directory to your $PATH by editing the .bash_profile file you've just created and adding the line export PATH=$PATH:~/bin. Then save the file.

  5. Reload your .bash_profile so that the updated $PATH is picked up by typing source ~/.bash_profile in the terminal.

You should now be able to use the subl command at the terminal prompt. It's also worth noting that you can put the bin folder anywhere you like if you don't want to put it in your home folder.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .