Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: "No such file or directory" when creating a symbolic link in sublime text editor so I can open it up from terminal

I'm trying to create a symbolic link so I can open Sublime Text from the terminal with subl . by entering in this line from the documentation:

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

But I'm getting the error:

No such file or directory

How can I fix this?

like image 485
Stack Overflow Avatar asked Oct 22 '14 15:10

Stack Overflow


Video Answer


2 Answers

It might be the backslash between Sublime and Text.app. I removed the quotations and this worked for me:

ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /Users/raulv/bin/subl
like image 174
raulv Avatar answered Sep 22 '22 02:09

raulv


Most likely you do not have a bin directory in your home directory (~). Use this command instead:

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

This will create the symlink in the system /usr/bin directory, which is already in your path. You need to use sudo because it's a system directory, meaning you'll need an Administrator password to complete the command. Be very careful when using sudo, as it gives you write access to everything, and you could rather easily nuke your system if you ran, for example:

sudo rm -rf /usr /bin/subl  # do NOT do this

which would destroy the entire /usr hierarchy (notice the space between /usr and /bin/subl?).

like image 25
MattDMo Avatar answered Sep 19 '22 02:09

MattDMo