Open directories with Sublime Text 2 using the command line (Mac OSX)

What about this: imagine if you could open your great Sublime Text 2 editor in a specific directory from the command line, well, today, I would like to share you the easiest way to configure that useful task in your Mac OSX. It is really simple, it just a matter of creating a symbolic link (a kind of direct access) to the subl executable.

Console-128

Next line do the task for you:

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

Once you have created the symbolic link, open a Terminal and run following command:

> subl directory_to_open
// Example: open my Desktop folder in Sublime Text 2
> subl /Users/alex/Desktop

That’s it! Now you can open any directory using the command line.

 

Añade un Comentario

One comment on “Open directories with Sublime Text 2 using the command line (Mac OSX)”

Leave a Reply

Your email address will not be published. Required fields are marked *