Unix Shell - Configuration Files For Shells

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 (1819–1891)

    It is not easy to make our lives respectable by any course of activity. We must repeatedly withdraw into our shells of thought, like the tortoise, somewhat helplessly; yet there is more than philosophy in that.
    Henry David Thoreau (1817–1862)