Categories: Mac tips

How to open Sublime Text in command line with subl on Mac OS?

I have tried to setup Sublime Text 3 so I could run it on my new Mac from terminal just typing subl . but all the when I wanted to make the symlink I was getting this error: ln: /usr/local/bin/subl: No such file or directory  all the time.

The problem is that I had no bin directory on that path. So to fix that you need to do the following:

cd /usr/local
sudo mkdir bin

Now we have that bin folder on /usr/local/bin path and now we can create the link using:

Sublime Text 3

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

Sublime Text 2

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

Exit the terminal and start it again and you should be able to use subl . to open all files in current folder in sublime text for editing.

Share
Published by
Nick

Recent Posts

How to Manage Storage on Smartphone: 12 Ways

Can't download new apps to your phone because there isn't enough storage space? Lack of…

10 months ago

Spotlight Search won’t open the files it finds in Dropbox with associated application

This issue started to appear on macOS 13 Ventura after recent Dropbox update. I would…

1 year ago

Windows 10 Search fix

Since this morning (Feb 5th 2020) search just stopped working on my Windows 10 (version…

4 years ago

The mysql_result in mysqli

Many of you have run into a problem when you were working on some old…

4 years ago

How to convert physical Windows PC into a virtual machine

After 10 years of running my main desktop computer on Windows 7 - time has…

4 years ago

How to downgrade PHP 7.4 to PHP 7.3 on VestaCP running on CentOS 7

I installed VestaCP for a clien on a new dedicated server running CentOS 7. Once…

5 years ago