Configuration Files For Shells
Shells read configuration files on multiple circumstances which differ depending on the shell. These files usually contain commands for that particular shell and are executed when loaded. These files are usually used to set important variables like $PATH used to find executables, and others that control the behavior and appearance of the shell. This table shows the configuration files for popular shells:
sh | ksh | csh | tcsh | bash | zsh | |
---|---|---|---|---|---|---|
/etc/.login |
login | login | ||||
/etc/csh.cshrc |
yes | yes | ||||
/etc/csh.login |
login | login | ||||
~/.tcshrc |
yes | |||||
~/.cshrc |
yes | yes | ||||
$ENV (typically ~/.kshrc) |
yes | |||||
~/.login |
login | login | ||||
~/.logout |
login | login | ||||
/etc/profile |
login | login | login | login | ||
~/.profile |
login | login | login | login | ||
~/.bash_profile |
login | |||||
~/.bash_login |
login | |||||
~/.bash_logout |
login | |||||
~/.bashrc |
int.+n/login | |||||
/etc/zshenv |
yes | |||||
/etc/zprofile |
login | |||||
/etc/zshrc |
int. | |||||
/etc/zlogin |
login | |||||
/etc/zlogout |
login | |||||
~/.zshenv |
yes | |||||
~/.zprofile |
login | |||||
~/.zshrc |
int. | |||||
~/.zlogin |
login | |||||
~/.zlogout |
login |
Explanation:
- blank means a file is not read by a shell at all.
- "yes" means a file is always read by a shell upon startup.
- "login" means a file is read if the shell is a login shell.
- "n/login" means a file is read if the shell is not a login shell.
- "int." means a file is read if the shell is interactive.
Read more about this topic: Unix Shell
Famous quotes containing the words files and/or shells:
“But some who this blithe mood present,
As on in lightsome files they fare,
Shall die experienced ere three days be spent
Perish, enlightened by the vollied glare;
Or shame survive, and, like to adamant,
Thy after shock, Manassas, share.”
—Herman Melville (18191891)
“It was the most wild and desolate region we had camped in, where, if anywhere, one might expect to meet with befitting inhabitants, but I heard only the squeak of a nighthawk flitting over. The moon in her first quarter, in the fore part of the night, setting over the bare rocky hills garnished with tall, charred, and hollow stumps or shells of trees, served to reveal the desolation.”
—Henry David Thoreau (18171862)