How to Open Sublime Text via Terminal

How to Open Sublime Text via Terminal

Written by Tony Lea on Jun 11th, 2013 Views Report Post

Back when I was using TextMate I was easily able to navigate to a directory in terminal and type 'mate .' and open up a specific file or directory in TextMate. Well with Sublime Text 2 you can do this as well. Here's how to do it using a Bash Shell. If you are using a different shell you'll just have to figure out which file you need to add a global alias. If you are using the Bash Shell you can navigate to your '~/.bash_profile'

and enter the following (If you are using a different version of Sublime Text you may have to modify the directory a little bit.

alias subl='/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl'

Now you can open a new terminal window, navigate to a specific directory and type in 'subl .' and your be able to open a specific directory or file directly from your terminal window. Hope that helps out someone else ;)

Comments (0)