codingbudgie
codingbudgie

Reputation: 327

How to create permanent subl link for Sublime Text 3? (Mac Catalina)

I'm new to working with Terminal and I'm trying to create a symlink to Sublime Text 3 in Terminal. I've already tried this ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/. but unfortunately it says "ln: /usr/local/bin/./subl: Permission denied". Also tried this: https://olivierlacan.com/posts/launch-sublime-text-3-from-the-command-line/ . But it still shows the same error.

Upvotes: 0

Views: 910

Answers (1)

MattDMo
MattDMo

Reputation: 102862

Use sudo:

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

You'll have to type in your password (assuming you have an administrator account), but it should work then.

Even using sudo, the exact command you put in your question wouldn't work, as it's attempting to symlink /usr/local/bin/. to the subl executable. Using /usr/local/bin/subl will work.

Upvotes: 3

Related Questions