environment variable configuration file in Linux

Source: Internet
Author: User

This article is my previous collation, this upload. Because just contact with Linux, has been on the inside of the variable set is confusing, so check the data to organize a bit, so that later query.

The Shell environment relies on settings for multiple files. Users do not need to manually set the various environment variables after each login, through the environment settings file, the user's work environment settings can be automatically logged in the system to complete. There are two types of environment settings files, one is the system environment settings file and the other is the personal environment settings file.

1) User working environment settings file in the system

Login environment settings File:/etc/profile

Non-logon environment settings file:/ETC/BASHRC

2) User-set environment settings file

Login environment settings file: $HOME/. Bash_profile

Non-logon environment settings file: $HOME/.BASHRC

Note: The profile is read only under certain circumstances, specifically when the user logs on. When shipped

After a shell script, you do not need to read the profile again.

The user environment file settings in the system are in effect for all users, and the environment settings files set by the user are

The body is in effect. Users can modify their user environment settings file to overwrite global settings in the System environment settings file.

For example:

1) The user can store the custom environment variables in the $home/. In Bash_profile;

2) The user can store the custom aliases in the $HOME/.BASHRC so that each login and call the child shell

is effective.


environment variable configuration file in Linux

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.