b__8xq
Last Updated: February 25, 2016
·
10.05K
· munday
7ec91bed500ba1022790b45aa3120217

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
Say Thanks
Respond

5 Responses
Add your response

22
Photo on 08.01.2013 at 04.15

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

over 1 year ago ·
4124
3da74875972640bed132255d8480f9f3

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
70e1167dbde5397557b0ec6fabb3d90a

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
Fdcee5f685a0ea7cbe5530dd5718dcfe

thanks!

over 1 year ago ·
14910

Thanks! Very helpful.

over 1 year ago ·