Ubuntu modifies environment variables

Source: Internet
Author: User

Have always been in the environment variable distress, so I looked for information,

The Ubuntu Linux system contains two types of environment variables: System environment variables and user environment variables. System environment variables are valid for all system users, and user environment variables are only valid for current users.

Modifying user environment Variables

User environment variables are usually stored in the following file: ~/.profile ~/.bash_profile or ~./bash_login ~/.BASHRC

The above files are not recommended for use in Ubuntu 10.0 versions. System Environment Variables

System environment variables are generally stored in the following file: /etc/environment /etc/profile /ETC/BASH.BASHRC

To add an environment variable:

method One:

$ VI ~/.BASHRC
Add Path= $PATH on the last line:/my_new_path:

$source ~/.BASHRC

Method Two: Note: Modify the environment variable path. Specific: Modify the/ETC/BASH.BASHRC file (available to all users)

$sudo VIM/ETC/BASH.BASHRC
Add at end of file:
Export path= $PATH:/my_new_path:

after modifying the path, turn off the terminal and reopen the terminal (or reboot)



not enough time today. I'll write a detailed introduction to each of the differences next time .

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.