Take the 2-minute tour ×

I know a few similar questions have been asked, but none seemed to help me so here it goes. I am trying to get sublime to run when I use 'subl' in the Linux terminal but I just cannot get it to work. I tried

sudo ln -s /Applications/Sublime\ Text\ 2/sublime_text usr/bin/subl 

and that did create the file correctly so it seems, but then when I use the subl command it says 'No command 'subl' found.' Now I have rvm installed, so that may make a difference. I also tried 'usr/local/bin/subl' and the result was the same. I even used the rvmsudo afterward with the above command and it said file already created, and yet the subl command still does not work. What am I missing here? Keep in mind that I am a)new to linux b)new to sublime. Running ubuntu 12.10 if it matters

share|improve this question
rvm lets you control multiple ruby/rails versions. It should not impact your sublime install. –  d_rail Feb 13 '13 at 21:49
Also, Applications/Sublime Text 2 is not the right folder for linux, I think that command is for Macs. On my computer sublime was installed at /usr/lib. –  d_rail Feb 13 '13 at 22:00

3 Answers 3

up vote 1 down vote accepted

I'm using Linux Mint 13, but should be similar for you. cd into /usr/bin. There should a file called sublime-text-2. Copy that file and name subl. Then subl command should be usable in the terminal.

cd /usr/bin
sudo cp sublime-text-2 subl

Just in case, here is the contents of the file:


/usr/lib/sublime-text-2/sublime_text --class=sublime-text-2 "$@"
share|improve this answer
Alright I looked in usr/bin and it had 2 files sublime_text and sublime_text~ so as instructed, I executed the commands cd /usr/bin sudo cp sublime_text subl Then it told me this: cp: not writing through dangling symlink 'subl' So does that mean I need to go back and delete those files I initially created with the sudo ln -s command? –  user2064883 Feb 13 '13 at 23:29
Yes. The symlink is broken because it is not pointing to anything. –  d_rail Feb 14 '13 at 0:43
so then I would do rm usr/bin/subl? Edit: Bingo! Thanks so much this finally worked! –  user2064883 Feb 14 '13 at 1:25

Brotherman, you have to update your path. It's probably easier than mucking around with ln -s softlinks. Go into your ~/.bashrc and at the bottom somewhere add export PATH=$PATH:/path/to/your/binary.

Then all you should have to do is . ~/.bashrc and voila!

share|improve this answer
Alright so I added export PATH=$PATH:/usr/bin/subl to the .bashrc file. Is that what you meant? And then I typed . ~/.bashrc into the terminal, hit enter, and restarted the terminal. But subl was still not recognized as a command. I guess I'm not even sure what you mean by a path to the binary. Is that similar to the .exe of a program in windows? I literally started using Linux for the first time yesterday. –  user2064883 Feb 13 '13 at 4:53
path is a list of directories in which the OS searches for binaries. If you echo $PATH you should see the correct path to your binary. –  Tyler Jandreau Feb 13 '13 at 13:16
So this is what I get when I type in echo $PATH: /home/aaron/.rvm/gems/ruby-1.9.3-p385@railstutorial/bin:/home/aaron/.rvm/gems/ru‌​by-1.9.3-p385@global/bin:/home/aaron/.rvm/rubies/ruby-1.9.3-p385/bin:/home/aaron/‌​.rvm/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/b‌​in:/sbin:/bin:/usr/games:/usr/local/games Now, with that information, what EXACTLY am I supposed to do? –  user2064883 Feb 13 '13 at 21:11

I think you had a typo. It should be

sudo ln -s /Applications/Sublime\ Text\ 2/sublime_text /usr/bin/subl 

Notice the / before usr. If you tell terminal usr/bin/subl, it'll take it as a relative path and create it in reference to the directory you were on when you executed this command.

share|improve this answer
When I typed that in, it said it failed to create symbolic link because the file exists so that must have been what I typed in the first place, just not in this question. In fact, I probably did it both ways just to try to get something to work. –  user2064883 Feb 13 '13 at 21:04
Ok. But it's really an obvious typo. Couldn't help pointing it out. :) –  Bibhas Feb 13 '13 at 21:23
You could try ls -al /usr/bin and see if subl is there and where it's linked to. –  Bibhas Feb 13 '13 at 21:24
it says subl -> /home/aaron/Applications/Sublime Text 2/sublime_text By the way, wtf is up with file structure browsing in Linux? If I go to the home folder, there is no folder named aaron. Also, if it matters, right below that first entry, it says sublime_text and then sublime_text~ if that matters –  user2064883 Feb 13 '13 at 23:22
Your "Home" folder is located at /home/username/. Irregardless, the symlink is not pointing to the right location. –  d_rail Feb 14 '13 at 0:50

Your Answer


