0

I want to know if there is any guidance I should be following somewhere (maybe from a man page or something) regarding creation of a ~/.bash_profile. By default Ubuntu 18.04 doesn't have one, it just has a .profile file. As I understand it, .profile should just be executing ~/.bashrc. Thus my assumption is that I just need to add a line at the end of my ~.bash_profile to execute ~/.bashrc ; something like:

[[ -f ~/.bashrc ]] && . ~/.bashrc

The reason I ask is because if I create this file, then my .profile file will not be called, so I just need to make sure I'm doing it right.

Second part of my question is, am I correct in understanding ~/.bash_profile should only be invoked ONCE during my login, and then that's it (i.e. sub-sequent interactive shells will just invoke only /etc/bash.bashrc followed by ~/.bashrc?

NotTheDr01ds
  • 22,082
john smith
  • 3,161

1 Answers1

0

I had similar questions about six months ago and got some excellent guidance. Please refer to my question and its answers.

I ended up putting in ~/.bashrc everything I needed for working at the command line and putting everything else in ~/.profile. I source ~/.bashrc at the top of ~/.profile and ~/.bash_profile.

If you'd like to look over the current incarnation of my dotfiles, such as they are, you're welcome to do so. They're reasonably well-organized (I think) and well-commented.

terdon
  • 104,119
MDeBusk
  • 1,386