It is quite confusing if you need to work with multiple, so I make following tables.
zsh
From section STARTUP/SHUTDOWN FILES of man page zsh
| Interactive Login | Non-Interactive Login | Interactive Non-Login | Non-Interactive Non-Login |
|---|---|---|---|
/etc/zshenv $ZDOTDIR/.zshenv |
|||
/etc/zprofile $ZDOTDIR/.zprofile |
– | ||
/etc/zshrc $ZDOTDIR/.zshrc |
– |
/etc/zshrc $ZDOTDIR/.zshrc |
– |
/etc/zlogin $ZDOTDIR/.zlogin |
– | ||
bash
From section INVOCATION of man page bash
default
| Interactive Login | Non-Interactive Login | Interactive Non-Login | Non-Interactive Non-Login |
|---|---|---|---|
/etc/profile Then the first one that is readable amongst: ~/.bash_profile ~/.bash_login ~/.profile |
~/.bashrc |
$BASH_ENV |
|
bash as sh
| Interactive Login | Non-Interactive Login | Interactive Non-Login | Non-Interactive Non-Login |
|---|---|---|---|
/etc/profile ~/.profile |
– | ||
$ENV |
– |
$ENV |
– |
tcsh
tcsh does not seem care the interactive mode when start up. if environment version has lf, then csh.login and ~/.login will run before csh.cshrc and ~/.tcshrc, respectively.
From section Startup and shutdown of man page tcsh
| Login | Non-Login |
|---|---|
/etc/csh.cshrc |
|
/etc/csh.login |
– |
First one that is readable amongst:
~/.tcshrc ~/.cshrc |
|
~/.history ~/.login ~/.cshdirs |
– |