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?
aliasbash
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?
Best Answer
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.