Open Sublime Text 3 from Terminal in macOS Mojave Linux

1- Mac OS:

Step 1:

First of all, test this command:

open /Applications/Sublime\

If that worked, you’re good to go step 2. If not, it means you should install sublime and drag the sublime application to the Applications directory.

Step 2:

Then run this command:

sudo ln -s /Applications/Sublime\ /usr/local/bin/subl

Step 3:

Checking in terminal by

subl .orsublime ~/Desktop

It will open the current directory or Desktop in Sublime Text! That’s it.


Sublime Text 3 ships with a CLI called subl which is located at (/Applications/Sublime
We want to create a symlink (symbolic link — or shortcut) of this “subl CLI utility” in the directory /usr/local/bin which is by default in the load path on OS X, and this work allows us to run the subl utility from our Terminal.

If you check your own $PATH by running:

echo $PATH

You will see something like what mine returns:

As you can see the /usr/local/bin path is included by default on OS X.

If you want to name the symlink sublime instead of subl you can do this:

sudo ln -s /Applications/Sublime\ /usr/local/bin/sublime

You should never have to type the full word anyway. Typing sub + Tab should auto-complete the full name of the symlink.

For having super and sub tabs refer to the Tip 2 at the end of this article.

2- Linux:

Before any thing, be sure that there is not already a symlink in /usr/bin/since in current versions of ST3 there is no need to any settings.

Just do this in terminal

subl .

But if it does not work, you just need to make a symlink by the following commands.

Depending on what you prefer you should choose one of these:

sudo ln -s /opt/sublime_text/sublime_text /usr/bin/sublime


sudo ln -s /opt/sublime_text/sublime_text /usr/bin/subl

Then go to a folder and do:

subl .
sublime .



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


Posting about Python and Laravel