These files –
.bash_profile – aren't reloaded automatically after you save changes to them.
bash doesn't monitor them for changes, they are only automatically evaluated during bash invocation.
After changing something, you need to explicitly load them. There are basically two ways:
source filename or the equivalent
. filename will evaluate
filename's contents in the current session. This is the easiest, if all you did was add or change existing definitions.
- Start a new
bash session, optionally closing your current one. Depending on how your terminal emulator works, you might need to launch
bash -i (for
bash --login (for
In modern, tabbed terminal emulators, this allows you to keep e.g.
vi .bashrc open in one tab, edit and save repeatedly, while opening new tabs to test the results. In case you mess it up and the new tabs are not useable, you can also easily revert any changes.
For more information on these files and when bash evaluates them, see
man bash's section INVOCATION.