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
Written by Matt Munday
Related protips
5 Responses
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
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#