/Etc/profile: This file sets the environment information for each user in the system. When the user logs on for the first time, this file is executed.
And collect shell settings from the configuration file in the/etc/profile. d directory.
/Etc/bashrc: execute this file for every user running bash shell. When bash shell is opened, the file is read.
~ /. Bash_profile: each user can use this file to enter the shell information dedicated to his/her use. When a user logs on,
The file is executed only once! By default, it sets some environment variables to execute the user's. bashrc file.
~ /. Bashrc: This file contains bash information dedicated to your bash shell. When you log on and every time you open a new shell,
The file is read.
~ /. Bash_logout: execute this file every time you exit the system (exit bash shell.
In addition, the variables (global) set in/etc/profile can act on any user ~ The variables (local) set in/. bashrc can only inherit the variables in/etc/profile. They are "Parent-Child" relationships.
~ /. Bash_profile is interactive and login to run in bash.
~ /. Bashrc runs in bash in interactive non-login mode.
Generally, the two settings are roughly the same, so the former usually calls the latter.