Environment variable loading sequence when Ubuntu 12.04 is started

Source: Internet
Author: User

When Ubuntu 12.04 is started, the environment variable loading sequence is used to figure out the startup sequence of various environment variable scripts in Linux. It is of great help to make good use of Linux to solve various strange errors that cannot find dependent files. The environment variable loading process at startup in Ubuntu is roughly:/etc/enviroment/etc/profile -->/etc/bash. bashrc -->/etc/profile. all. sh file ~ /. Profile (or ~ /. Bash_profile or ~ /. Bash_login) --> ~ /. Bashrc (if bash is run) --> ~ /. Bash_aliases -->/etc/bash_completion the first two are system environment variables, and the last is the local environment variables of the current user. /Etc/enviroment is called first after some core components of the system are loaded. Many peripheral Programs depend on it to run. If there is any problem, the system may fail to start normally. As a result, the system-level public environment variable/etc/profile is first executed when the login environment is started. Equivalent to the application-level public environment variable ~ /. Profile: when the shell is opened, others/etc/profile is executed. Pay attention to application-level user environment variables ~ /. Profile is executed when the shell is opened. That is to say, if the environment variables configured in the script or the script it will call (generally. bashrc) are invalid in the graphic interface! If you want to configure an environment variable that is still valid in the graphic interface, you can create a. sh file under/etc/prfile. d/and write the corresponding content, such as JAVA_HOME.

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.