44

After following this tutorial, I cannot launch Sublime Text from command line. How can I fix this?

Seth
  • 58,122
sonnuforevis
  • 1,533

5 Answers5

54

After following this tutorial and facing the reported problem, I googled it and realised that I had forgot to create a symbolic link.

sudo ln -s /opt/sublime/sublime_text /usr/bin/subl

Now the problem is solved :)

sonnuforevis
  • 1,533
42

For recent versions of Ubuntu and Sublime Text 3, I'm adding a symlink like this:

sudo ln -s /opt/sublime_text/sublime_text /usr/local/bin/subl

Then I can execute it from terminal like subl myFile.php.

Arda
  • 1,320
  • 11
  • 15
8

For anyone who is struggling for sublime text 3.

After creating symlink for opening ST3 use :

subl .

dont use:

sublime .
abu_bua
  • 10,783
arjun sah
  • 181
2

for those who install sublime in Ubuntu Software, just type

sudo ln -s /snap/sublime-text/38/opt/sublime_text/sublime_text /usr/local/bin/subl
  • 1
    I suggest using the "current" version link, so the command becomes sudo ln -s /snap/sublime-text/current/opt/sublime_text/sublime_text /usr/local/bin/subl – Tom Mar 28 '19 at 07:32
  • In Mint 20 I found it in "/var/lib/flatpak/app/com.sublimetext.three/current/active/export/bin/com.sublimetext.three" – nick fox Dec 23 '20 at 15:18
2

Personally I prefer creating an alias in ~/.bashrc, to avoid having to keep track of symbolic links:

alias subl=/opt/sublime_text/sublime_text
David Foerster
  • 36,264
  • 56
  • 94
  • 147
gaterush
  • 129