Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 am trying to get sublime text to run from the command line using this tutorial

It says to run this command:

ln -s "/Applications/Sublime Text" ~/bin/subl

But when I try to run that command I get an error "no such file or directory." Sublime text 2 is in my applications folder -- but it looks like there is no bin folder in my home directory. Do I need to create one? Is this something that should be there? Am I doing something wrong?

share|improve this question

If you have administrator access on your machine, the easiest way is to put a symlink in the /usr/bin directory, as it already exists, and is already in your PATH, or the list of places the shell looks for commands to run. All you need to do is enter the following in a Terminal session:

sudo ln -s "/Applications/Sublime Text" /usr/bin/subl

If you've never run this before, you'll likely get a short warning that essentially says "Make sure you know what you're doing, and even then think about it twice before doing it. You can really screw stuff up bad with this." Type in your password at the prompt, and you should be all set.

The sudo command, which stands for "SuperUser DO", allows you to run commands with elevated privileges, in this case allowing you to create a file in the /usr/bin directory, which normally doesn't allow the creation of new files in it. This is exactly the same as entering your password when installing a new program.

Once you've run the above command, quit your Terminal session completely (using Q, not just shutting the window) and restart it, and you should now be able to run subl filename.txt at the command line and open any file you want in Sublime.

Good luck!

share|improve this answer

Note: Somewhere along the line they took the " 2" off the end of the app name... When they did that all of the docs that show how to get subl to work became obsolete.

The old answers still work if you remove the " 2" from the end of Sublime Text 2

share|improve this answer

Only try ln -s "/Applications/Sublime Text\" ~/bin/subl if you have version 2

remember the \

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.