Bash_profile and. BASHRC . BASHRC to save personal personalization settings, such as command aliases, paths, and so on. after each modification. BASHRC, using source ~/.BASHRC (or. ~/.bashrc), you can immediately load the modified settings to make them effective. The is typically called explicitly in the. bash_profile file. bashrc. Log in to Linux to start bash first read the ~/.bash_profile file, So ~/.BASHRC will be executed, your personalized settings will be effective. But not all Linux has bash_profile files. /etc/profile: This file sets the environment information for each user of the system, and the file is executed when the user logs on for the first time. and collect the shell settings from the configuration file of the/ETC/PROFILE.D directory. /ETC/BASHRC: Executes this file for each user running the bash shell. When the bash shell is opened, the file is read. ~/.bash_profile: Each user can use the file to enter shell information that is dedicated to their own use, and the file executes only once when the user logs on! By default, he sets some environment variables to execute the user's. bashrc file. ~/.BASHRC: This file contains bash information dedicated to your bash shell, which is read when you log on and every time you open a new shell. ~/.bash_logout: Executes the file each time it exits the system (exiting the bash shell). In addition, variables set in/etc/profile (global) can be applied to any user, while variables set in ~/.BASHRC, etc. (local) only inherit variables from/etc/profile, they are "parent-child" relationships. The ~/.bash_profile is interactive, the login way into bash runs ~/.BASHRC is the interactive non-login way into the bash run usually the two settings are roughly the same, so the former is usually tuned Use the latter. The alias set for aliases to be permanently valid requires that the command be added to the. BASHRC |