If you are new to Mac OS X, you may need to know how to edit your PATH. The good news is that this is an easy task on Mac OS X.
The recommended way is by editing your .bash_profile file. This file is read and the commands in it executed by Bash every time you log in to the system. The best part is that this file is specific to your user so you won’t affect other users on the same system by changing it.
Please follow the below simple steps and let me know if you have any doubts:
- Start up Terminal
- Type “cd ~/” to go to your home folder
- Type “touch .bash_profile” to create your new file.
- Edit .bash_profile with your favorite editor (or you can just type “open -e .bash_profile” to open it in TextEdit.
- Type “. .bash_profile” to reload .bash_profile and update any functions you add.
Note: You can add multiple environment variables by separating them with colon i.e “:”