Last Updated: February 25, 2016
·
973
· shinn

Start Sublime text 2 from OS X terminal

Running stuff from terminal is always faster compare to GUI, and it's my favorite way of working since I stepped into the UNIX-like scene.

Recently when I was setting up Sublime Text 2 on a new machine, I found that this Sublime Text 2 documentation for OSX terminal is outdated.

The current appropriate way to link Sublime Text 2 to use the subl command is:

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

Updated:
For Sublime Text 3, use the same command with an updated directory name. And remember to remove the existing link if you want to use subl command for Sublime Text 3.

# Remove existing sublime text 2 link
$ rm /usr/local/bin/subl
$ ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl

1 Response
Add your response

Great tip!

Remember that you can always change the symlink to

/usr/local/bin/sublime

if you like the full name over the abbreviation (as I do).

over 1 year ago ·