After following this tutorial, I cannot launch Sublime Text from command line. How can I fix this?
Asked
Active
Viewed 2.1e+01k times
5 Answers
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 :)
Bilesh Ganguly
- 514
- 7
- 18
sonnuforevis
- 1,523
- 6
- 15
- 19
-
3I think it would be better to use [/usr/local/bin instead of /usr/bin](https://unix.stackexchange.com/questions/8656/usr-bin-vs-usr-local-bin-on-linux/8658#8658). – lev Jan 26 '15 at 09:17
-
10Do not do this with current versions of ST3 ... its already baked in – Scott Stensland Oct 17 '15 at 05:10
-
2Did not occur for me using ST3, had to manually link. No command line options were available otherwise. – gnomed Apr 28 '16 at 18:01
-
4To launch sublime you need to run `subl` from the Terminal. – E235 Jan 09 '18 at 10:53
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
-
6+1 for using [/usr/local/bin instead of /usr/bin](https://unix.stackexchange.com/questions/8656/usr-bin-vs-usr-local-bin-on-linux/8658#8658). – lev Jan 26 '15 at 09:09
-
I was trying to open sublime text 3 using `sublime file.php`. Thanks to point that the correct command is `subl`. It worked without creating the symlink. – campsjos Mar 22 '17 at 12:50
-
-
@wotter check the reply that he linked: https://unix.stackexchange.com/questions/8656/usr-bin-vs-usr-local-bin-on-linux/8658#8658 – Arda Apr 22 '19 at 11:07
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
Morris Tai
- 29
- 1
- 5
-
1I 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
- 35,754
- 55
- 92
- 145
user10000000
- 129
- 2