Link: mac
Edit $HOME/.bash_profile
file to set or change $PATH under macOS
- Open the Terminal app on macOS.
- Enter below command to open
.bash_profile
vi $HOME/.bash_profile # Or, alternatively, use nano as editor (more user friendly for people who doesn't know vim key binding) nano $HOME/.bash_profile
- Add the desired PATH
# e.g. for emacs PATH, it looks like this: export PATH="$HOME/.emacs.d/bin:$PATH
- Save and close in terminal. For vi/vim, enter
:wq
to save and exit. - Enter below command in Terminal to apply the change
source $HOME/.bash_profile
- Verify
echo "$PATH"