Picture of Michael Lee
:wave: Hey hey, I'm Michael Lee and this is my site about being a developer, being a dad and making side projects.

Open Sublime Text from the Mac Terminal

Written on August 27, 2014

Sublime Text, like MacVim has a useful command line tool that allows you to open Sublime Text and files in Sublime Text from the Mac Terminal.

Setting this up is pretty straight forward. Simply enter this command in Terminal:

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

What the command does is create a symlink of the command line tool in your bin folder. The bin folder is where other executable binary files exist.

While creating the symlink, Terminal might complain about not being able to execute the command. If this happens, simply add sudo in front of the command and type in your login password.

Now that the tool is installed you can execute commands like these from Terminal:

//Opens Sublime Text
subl

//Opens current directory in Sublime Text
subl .

//Opens file in Sublime Text
subl filename
Thanks for taking the time to read this article. I'd love to stay in touch and share more tips on programming and design and side projects. Sign up and I'll send you my articles straight to your email.