Dup Goto 📝

Bashrc-vs-Profile

PT2/linux/shell 07-31 13:46:40
To Pop
12 lines, 71 words, 530 chars Monday 2023-07-31 13:46:40

See e.g. this at baeldung.com

Basically, in an interactive login shell

  1. `/etc/profile
  2. User profile
    1. ~/.bash_profile if present; else
    2. ~/.bash_login if present; else
    3. ~/.profile if present but not .bashrc. Thus usually, .bashrc is sourced by the .profile.

The issue is the overhead in setting everything up, since .bashrc is run every time a new shell is opened, and most variables can be inherited from the login shell.