Skip to content

Instantly share code, notes, and snippets.

@bahamat
Last active March 15, 2023 02:42
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bahamat/5df07efb1d3dd059e7f0538cb5514e15 to your computer and use it in GitHub Desktop.
Save bahamat/5df07efb1d3dd059e7f0538cb5514e15 to your computer and use it in GitHub Desktop.
How are various shells configured, and in which order?

ash & dash

login interactive files
N N
N Y $ENV
Y N /etc/profile, ~/.profile
Y Y /etc/profile, ~/.profile, $ENV

bash

login interactive files
N N $BASH_ENV
N Y ~/.bashrc
Y N /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile
Y Y /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile

bash invoked as sh

login interactive files
N N $ENV
N Y ~/.bashrc
Y N /etc/profile, ~/.profile
Y Y /etc/profile, ~/.profile

csh (illumos)

login interactive files
N N /etc/csh.cshrc, ~/.tcshrc OR ~/.cshrc
N Y /etc/csh.cshrc, ~/.tcshrc OR ~/.cshrc
Y N /etc/csh.cshrc, /etc/csh.login, ~/.tcshrc OR ~/.cshrc, ~/.history, ~/.login
Y Y /etc/csh.cshrc, /etc/csh.login, ~/.tcshrc OR ~/.cshrc, ~/.history, ~/.login

tcsh

login interactive files
N N
N Y ~/.cshrc
Y N
Y Y /etc/.login, ~/.tcshrc OR ~/.cshrc, ~/.login

ksh

login interactive files
N N
N Y /etc/ksh.kshrc, $ENV
Y N /etc/profile, ./.profile ~/.profile
Y Y /etc/profile, ./.profile ~/.profile, /etc/ksh.kshrc, $ENV

zsh

login interactive files
N N /etc/zshenv, $ZDOTDIR/.zshenv
N Y /etc/zshenv, $ZDOTDIR/.zshenv, /etc/zshrc, $ZDOTDIR/.zshrc
Y N /etc/zshenv, $ZDOTDIR/.zshenv, /etc/zprofile, $ZDOTDIR/.zprofile, /etc/zlogin, $ZDOTDIR/.zlogin
Y Y /etc/zshenv, $ZDOTDIR/.zshenv, /etc/zprofile, $ZDOTDIR/.zprofile, /etc/zshrc, $ZDOTDIR/.zshrc, /etc/zlogin, $ZDOTDIR/.zlogin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment