Why must I do `. .bash_profile` every time I create a new alias?

Every time I add a new alias in my .bash_profile file, I found that I must do the command . .bash_profile in my terminal to make it work.

Why does the alias not work automatically?


Solution 1:

First of all, you should put the aliases in ~/.bashrc and not in ~/.bash_profile.

Next the explanation: the aliases are read and make available only when the file that contain them is read. So the requirement to source that file.