Error: "There is no such file or directory" when creating a symbolic link in a sublime text editor so that I can open it from the terminal

I am trying to create a symbolic link so that I can open Sublime Text from a terminal using subl . by entering the documentation on this line :

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

But I get an error message:

No such file or directory

How can i fix this?

+5
source share
5 answers

Most likely, you do not have the 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 a symlink in the /usr/bin system directory, which is already in your path. You need to use sudo because it is a system directory, i.e. you need an administrator password to execute the command. Be very careful when using sudo, as it gives you write access to everything, and you could easily destroy your system if you started, for example:

 sudo rm -rf /usr /bin/subl 

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

+5
source

It may be the file /Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl does not exist, or you may have incorrectly specified the path

or

The bin directory does not exist in your home directory.

0
source

The command is completely fine, but make sure that there is the following path "/ Applications / Sublime Text 2.app/Contents/SharedSupport/bin/subl"

0
source

It can be a backslash between Sublime and Text.app. I removed the quotes and it worked for me:

 ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /Users/raulv/bin/subl 
0
source

With Sublime Text 3 and on Mac OS High Sierra, I created a symbolic link as

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

NOTE. On Mac OS High Sierra, this operation is prohibited under "/ usr / bin". But you can create a symlink in "/ usr / local / bin"

Make sure that "/ usr / local / bin" is in the path.

0
source

Source: https://habr.com/ru/post/1205288/


All Articles