/etc/profile,/ETC/BASHRC, ~/.bash_profile, ~/.BASHRC are easily confused, what is the difference between them? What is their role in the end?
/etc/profile: Used to set the system environment parameters, such as $path. This environment variable is in effect for all users in the system .
/ETC/BASHRC: This file sets the system bash shell-related stuff into effect for all users in the system. As long as the user runs the Bash command, the inside thing is working.
~/.bash_profile: Used to set some environment variables, functions and/etc/profile similar, but this is set for the user, that is, you set the environment variables in the/home/user1/.bash_profile, Then this environment variable is only valid for the User1 user.
~/.BASHRC: Acts similar to/ETC/BASHRC, but only for the user itself, not for other users.
In addition, the variables set in/etc/profile (global) can be applied to any user, while the variables set in ~/.BASHRC etc. (local) only inherit variables from/etc/profile, they are "parent-child" relationships.
~/.bash_profile is interactive and login to bash, meaning it only takes effect if the user logs on.
~/.BASHRC is an interactive non-login way into bash, and the user is not necessarily logged in, as long as the command line is run as that user and the file is read.
http://blog.csdn.net/dingxy/article/details/4016383
The difference between profile and BASHRC four in Linux