Last Updated: February 25, 2016
·
10.42K
· munday

Launch Sublime Text 2 from a terminal in Mac OS

To make the subl command available, Link the subl binary in the application to a location in the $PATH environment variable:

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

Then you can call subl from anywhere to launch the editor:

subl test.txt

5 Responses
Add your response

You can also skip sudo and link to /usr/local/bin/subl

over 1 year ago ·

Or you can create an alias for it (If you add it to your .bashrc, you'll always have it working).

$ alias subl="open -a 'Sublime Text 2'"
$ subl file
over 1 year ago ·

to create an alias on Windows for git bash add this alias to your .bashrc

$ alias subl="start sublime_text.exe"

and pro re nata

$ subl .
over 1 year ago ·

thanks!

over 1 year ago ·

Thanks! Very helpful.

over 1 year ago ·