-1

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?

3
  • 1
    Did you try logging out and in again or rebooting?
    – dessert
    Oct 13, 2018 at 21:14
  • 2
    See: stefaanlippens.net/bashrc_and_others the .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.
    – Terrance
    Oct 13, 2018 at 21:21
  • @dessert yes. rebooting doesn't work.
    – FidelVe
    Oct 13, 2018 at 21:37

2 Answers 2

1

as pointed out in the following link (posted by @Terrance) https://www.stefaanlippens.net/bashrc_and_others/

The Answer is to add the info into .bashrc not .bash_profile

1
  • 1
    My rule of thumb is: anything that is specifically for interactive use (aliases, functions, the prompt, etc) goes in .bashrc (or into files that the .bashrc sources), and things that not for interactive use (env vars) goes in the .profile Oct 13, 2018 at 21:56
0

You can configure your gnome-terminal profile to open new tabs as login sessions, so that .bash_profile gets re-read.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .