Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sublime Text 2: can't create symlink to subl, says "bin/subl: No such file or directory"

Tags:

sublimetext2

I've downloaded and installed Sublime text 2. I am following the directions here: but I am stuck at this part:

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:

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

However, when I do this it tells me /Users/User/bin/subl: No such file or directory.

What should I do?

Thanks!

like image 754
user1404456 Avatar asked May 18 '12 23:05

user1404456


4 Answers

I'd recommend adding it to your local bin:

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

Edit: Make sure your local bin directory exists before running this command:

mkdir /usr/local/bin
like image 189
NotSimon Avatar answered Oct 20 '22 16:10

NotSimon


I add my sym links to /usr/local/bin, for Sublime Text 3 I set mine up like so:

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

Then you can open up the current directory list using:

subl .

If you find subl abbreviation annoying as some people I know seem to do, then change it to 'sublime'

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

And call it using:

sublime .
like image 30
Kingsley Ijomah Avatar answered Oct 20 '22 16:10

Kingsley Ijomah


Alternatively, you can run this:

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

Note: The above snippet puts the symlink in /bin/subl rather than ~/bin/subl.

like image 37
Trent Scott Avatar answered Oct 20 '22 15:10

Trent Scott


and that you have a ~/bin directory in your path

First, you need that directory for the ln command to work, and eventually, it will need to be in your path to do whatever it is you are trying to do.

To make the directory:

mkdir ~/bin

Adding it to your execution path is trickier, but there are plenty of resources available.

like image 7
jgritty Avatar answered Oct 20 '22 16:10

jgritty