I added the following to my .bash_profile
alias lr='ls -hartl'
alias q='grep -i'
alias get='curl -OL'
then
source .bash_profile
the aliases worked as expected.
But if I close the shell and open it again (Ctrl+Alt+T) I have to source .bash_profile
again for the changes to be implemented.
Is there a way to make this permanent so I don't have to source .bash_profile
every time I open a new shell?
.bash_profile
is loaded when it is a login shell, but since you are not creating a login shell at the time of opening a new terminal it is not called each time. If you added the lines to the.bashrc
file it would be called each time. If you keep the lines in the.bash_profile
then you would need to log out and log back in for the changes to be permanent.