Put the line to modify PATH
in ~/.profile
, or in ~/.bash_profile
or if that's what you have. On macOS(If your login shell is zsh and not bash, you may need to useput it in ~/.zprofile
instead, even if it doesn't already exist. In all these cases)
The profile file is read by login shells, so it will only take effect the next time you must log out and then back in for changes. (Some systems configure terminals to read a login shell; in that case you can start a new terminal window, but the setting will take effect only for programs started via a terminal, and how to set PATH
for all programs depends on the system.)