Add Sublime to environment variables in Ubuntu

Source: Internet
Author: User
Tags sublime editor
We recommend that you use the Sublime Editor, which is much easier to use than vim. After decompression, it can be used directly, but it is inconvenient to switch to its path. In Ubuntu, add the sublime path to the environment variable, and directly enter sublime in the future. The sublime_text executable file is in the/root/Downloads/SublimeText2 directory. In order to directly input sublime to execute sublime_text, enter the following content on the terminal:

We recommend that you use the Sublime Editor, which is much easier to use than vim. After decompression, it can be used directly, but it is inconvenient to switch to its path. In Ubuntu, add the sublime path to the environment variable, and directly enter sublime in the future.

The sublime_text executable file is in the/root/Downloads/Sublime Text 2 directory. In order to directly input sublime to execute sublime_text, enter the following content on the terminal:

# Cp sublime_text sublime

There are two methods: the first method takes effect after logon, but it is permanent; the second method takes effect immediately, but only valid on the current terminal.

Method 1:

# Gedit/etc/environment

The content of the environment file is as follows:

PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"

Add the Sublime path (Note: The paths are separated by colons ):

PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games: /root/Downloads/Sublime Text 2"

Save and log on again.

# Echo $ PATH

/Usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games: /root/Downloads/Sublime Text 2

Check the current PATH environment variable. We can see that the Sublime PATH has been added to the environment variable.

Enter sublime in the terminal to use it.

Method 2:

// Add a new PATH to the PATH environment variable.

# Export PATH = $ PATH:/root/Downloads/Sublime \ Text \ 2

Note: # The command is later. # indicates the Command executed by a Super User.

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.