43

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

0

5 Answers 5

53

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 :)

4
  • 3
    I think it would be better to use /usr/local/bin instead of /usr/bin.
    – lev
    Jan 26, 2015 at 9:17
  • 10
    Do not do this with current versions of ST3 ... its already baked in Oct 17, 2015 at 5:10
  • 2
    Did not occur for me using ST3, had to manually link. No command line options were available otherwise.
    – gnomed
    Apr 28, 2016 at 18:01
  • 4
    To launch sublime you need to run subl from the Terminal.
    – E235
    Jan 9, 2018 at 10:53
39

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.

4
7

For anyone who is struggling for sublime text 3.

After creating symlink for opening ST3 use :

subl .

dont use:

sublime .
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
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
2
  • 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, 2019 at 7: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, 2020 at 15:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.