MAC setting environment variable
Posted Jun 15, 2020 • 1 min read
Run pwd to get the absolute path of the current path.
Set the PATH
Find the location of the .bash_profile file(generally in the user directory) and execute the following command.
a. touch .bash_profile
b. open -e .bash_profile
c. Edit PATH, the command is as follows:
Among them, the ":" colon is used to split multiple environment variable addresses.
d. source .bash_profile
In the process of settlement, the relevant information is as follows:
- About the loading order of MAC environment variables
- vim exit command
:q means exit
:wq means save and exit
:q! means force to exit without saving
- If the setting is wrong, commands such as ls cannot be used, use the following command to temporarily restore.