Saturday, May 28, 2016

How to open Sublime from command line Lubuntu


Sublime text is a very popular web editor that everybody loves and sometimes (i don't know why) you want to open sublime text from command line, how to do that?

Sublime text binary is located at /opt/sublime_text/sublime_text for sublime 3 and /opt/sublime_text_2/sublime_text for sublime version 2, so basically you can call directly like this:

sudo /opt/sublime_text/sublime_text
sudo /opt/sublime_text_2/sublime_text

But there is a better way to do this, recently i found out that actually sublime text has command that can be called from everywhere on the command line, simply run this command to open sublime text:

sudo subl

The subl command is available globally, so you can run this command from anywhere on the system, note that you don't have to put sudo command if you don't need it, the command still works even without sudo.

Why i put sudo? because i just want to point out that most of the time i run sublime text with sudo, because i'm editing php file that lives inside root directory and under root privilege.

No comments:

Post a Comment