Common environment variable configuration file under Mac
1./etc/profile (it is not recommended to modify this file)
A global (public) configuration that reads the file when logged on, regardless of the user.
2./ETC/BASHRC (typically add system-level environment variables to this file)
Global (public) configuration, which will be read by the bash shell, regardless of the way it is executed.
3.~/.bash_profile (typically add user-level environment variables to this file)
(Note: Linux is. BASHRC and Mac is. Bash_profile)
This file will not be read until the bash shell is executed in login mode.
Make the environment variable effective when modified:
After you modify the environment variables, you need to restart or log back in to reload the environment variables to take effect.
If you want to take effect immediately, you can execute the following statement (with a. bash_profile example):
source. bash_profile
Or
. . bash_profile
This is also done on Linux.
environment variable configuration under Mac