How to launch Sublime Text App from Mac OSX Terminal ?

Hello,

It is quite simple to do this. Just follow the steps.

1. Open the Terminal and run ln -s “/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl ” /usr/local/bin/sublime

This will create a symlink called sublime between the subl binary stashed in Sublime application package and the folder where your system usually looks for binaries to execute(launch).

2. If the above command gives you an error saying   ln: /usr/local/bin/sublime: Permission denied. execute the command again by using sudo

Quick tip here: Just run sudo !!  instead of copying and pasting the entire path again. This will execute the previous command.

3. Now run open ~/.bash_profile and add  /usr/local/bin if you don’t have it in the $PATH.

4. Now execute source ~/.bash_profile if you have made any changes to the file. This command reloads your .bash_profile

5. Now run sublime command in the terminal to launch the application.

or

run sublime . to open an entire directory with the sublime text

or

run sublime folder name or file name to open a specific folder or file

 

Cheers,

SZ

 

 

One comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s