Note: The content mentioned in this Article applies to Ubuntu 10.10
Environment configuration file in Ubuntu:
(1)/etc/enviroment is the environment variable of the system.
(2)/etc/profile: environment variables of all users. When you log on for the first time, the file is executed and shell settings are collected from the configuration file in the/etc/profile. d directory.
(3)/etc/bashrc: execute this file for every user running bash shell. When bash shell is opened, the file is read.
(4 )~ /. Bash_profile: each user can use this file to input the shell information dedicated to their own use. When a user logs on, this file is only executed once! By default, it sets some environment variables to execute the user's. bashrc file.
(5 )~ /. Bashrc: This file contains bash information dedicated to your bash shell. This file is read when you log on and every time you open a new shell.
(6 )~ /. Bash_logout: execute this file every time you exit the system (exit bash shell). In addition, the variable (global) set in/etc/profile can act on any user, and ~ The variables (local) set in/. bashrc and so on can only inherit the variables in/etc/profile. They are "Parent-Child" relationships.
(7 )~ /. Bash_profile is interactive and login to run bash ~ /. Bashrc is the interactive non-login mode that enters Bash. Generally, the two settings are roughly the same, so the former usually calls the latter.