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:
“The good husband finds method as efficient in the packing of fire-wood in a shed, or in the harvesting of fruits in the cellar, as in Peninsular campaigns or the files of the Department of State.”
—Ralph Waldo Emerson (18031882)
“As many as the shells that are on the shore, so many are
the pains of love; the darts that wound are steeped in
much poison.”
—Ovid (Publius Ovidius Naso)