Bash startup files


Options and modes

  • -l — login shell
  • -i — interactive shell


  • Login Bash sources the first existing and readable file from the following list:
    • ~/.bash_profile
    • ~/.bash_login
    • ~/.profile
  • ~/.bashrc is sourced by Bash as interactive shell only.
  • $BASH_ENV:
    • environment variable with the filename of init script;
    • sourced only before executing Bash script as non-interactive shell;
    • applied expansions (in order):
      • parameter expansion;
      • arithmetic expansion;
      • command substitution.

See Also