b__8xq
Last Updated: February 25, 2016
·
10.15K
· 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

22

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

over 1 year ago ·
4124

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 ·
4531

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 ·
13827

thanks!

over 1 year ago ·
14910

Thanks! Very helpful.

over 1 year ago ·