Environment variables in the shell

Source: Internet
Author: User

Environment variables in Linux include system-level and user-level, system-level environment variables are system variables to be read by every user logged into the system, and user-level environment variables are the environment variables that are loaded when the user uses the system.
Therefore, the management environment variable files are also divided into system-level and user-level, the following posted on the Internet to find a more clear description of the document (slightly modified) [1]:

System level:
/etc/profile: This file is the first file that is used by the operating system to customize the user environment when the user logs on, and applies to every user who logs on to the system. This file is typically called the/ETC/BASH.BASHRC file.
/ETC/BASH.BASHRC: System-level BASHRC file.
/etc/environment: The second file used by the operating system at logon, the system sets environment variables for environment files before reading your own profile.

User level (these files are in the home directory):
~/.profile: Each user can use this file to enter shell information dedicated to their own use, when the user logs on, the file is only executed once! By default, he sets some environment variables to execute the user's. bashrc file. This is where personal settings are recommended.
~/.BASHRC: This file contains bash information dedicated to your bash shell, which is read when you log in and every time you open a new shell. It is not recommended to put it here, because every time you open a shell, the file will be read once and the efficiency must be affected.
~/.bash_profile or ~./bash_login: There is no reference to the author here, the following will mention
~/.pam_environment: User-level environment variable settings file, did not do the test, do not know whether the tube is used.

Environment variables in the shell

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.