Sublime Forum

Starting Sublime text from command line

#1

Hi,

( I am on a MAc, with Mountain Lion)

I cannot start ST on the command line, I have “ln -s “/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl” ~/bin/subl”

when I on the command line enter: subl or subl text.txt I get an error message: -bash: subl: command not found

If I open ‘subl’ in my /bin folder (under my home folder) I find this:

Last login: Thu Sep 6 15:02:20 on ttys000
Per-Olofs-iMac:~ perherman$ /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl ; exit;
logout

[Process completed]

Even if I go to my bin-folder nothing happens if I enter: ‘subl’

Help appreciated!

Thanks

Per-olof

0 Likes

#2

I simply use the MacOSX open command and it works without creating “subl” file. You can easily just alias below in your “~/.bash_profile” and it should work for you.

open -a "Sublime Text 2"
0 Likes

#3

Looks like your ~/bin folder is not in your path. One way to tell is to run:
which subl

This will print out the directory that it’s found in. It prints out nothing if it’s not found. You can also look at what’s in your path by doing:
echo $PATH

I’d recommend putting the symbolic link in:
/usr/local/bin

This is in your path by default and is a nice place for things like that to go.

0 Likes