Bash Configuration Files
This article describes how bash executes its startup files. If any of the files exist, but cannot be read, bash reports an error.
Interactive Login Shell
This sequence is executed by an interactive login shell, or a shell that was invoked with
├─→ /etc/profile ─→ /etc/profile.d/*.sh │ │ └─→ ~/.bash_profile ─→ ~/.bash_login ─→ ~/.profile # executes the first one that exists and it is readable
When more than one of
~/.profile exists and it is readable, the first one, in this order, is executed.
Interactive Non-Login Shell
Invoked with the name "sh"
Invoked by Remote Shell Daemon
Invoked with Unequal Effective and Real UID/GIDs
Setting Configuration for all Users, Including root
Found this comment in
# Bash login shells run only /etc/profile # Bash non-login shells run only /etc/bashrc