Linux environment variable problem

Source: Internet
Author: User

environment variable Extension:

The difference between/etc/profile,/ETC/BASHRC,. Bash_profile and. BASHRC

When the user logs on to the Linux operating system, "/etc/profile", "~/.bash_profile" and other configuration files will be automatically executed.
Execution Process--
Start "/etc/profile" first,
The "~/.bash_profile" in the user directory is then launched, and the "~/.bash_login" and "~/.profile" files are called in turn after they are executed "~/.bash_profile" if they exist.

/etc/profile: This file sets the environment information for each user of the system, and when the user first logs on, the file is executed and the shell's settings are collected from the settings file of the/ETC/PROFILE.D directory;/ETC/BASHRC: Run bash for each The shell user executes this file, and when the bash shell is opened, the file is read; ~/.bash_profile: Each user can use the file to enter shell information dedicated to their own use, and when the user logs in, the file executes only once! By default, he sets some environment variables to execute the user's. bashrc file, ~/.BASHRC: The file contains bash information dedicated to your bash shell, which is read when logged in and every time a new shell is opened; ~/.bash_logout: When the file is executed each time it exits the system (exiting the bash shell),/etc/profile is a global feature in which variables set in all user ~/.bash_profile can inherit variables from the/etc/profile and be used for the user. ~/.bash_profile is interactive, login way into bash run, ~/.BASHRC is interactive non-login way into bash run

  

Linux environment variable problem

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.