How to determine the current shell type in Linux or Unix.

Here is the command to find out what your current shell type is in Linux or Unix. This works for most variants of Unix, Aix, and Linux.

echo $0, this will display the shell type.

echo $SHELL, this will give you more detailed shell type information.

Below is a table of the various shell types and their configuration files

Shells read configuration files on multiple circumstances which differ depending on the shell. This table shows the configuration files for popular shells:

(Please Note: If the table below is not displayed is the right format, then please refresh your screen by clicking on refresh on your browsers toolbar or press the F5 key on your keyboard.)

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
~/.login login login
~/.logout login login
/etc/profile login login i.login
~/.profile login login login
~/.bash_profile login
~/.bash_login login
~/.bash_logout login
~/.bashrc 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