Linux check which shell is used
How to know which shell I am using in Linux
echo $0
- ($0) Expands to the name of the shell or shell script
How to know my default shell in Linux
echo $SHELL
For example:
[j@localhost ~]$ echo $SHELL #Default shell is bash
/bin/bash
[j@localhost ~]$ echo $0 #Current shell is also bash
bash
[j@localhost ~]$ ksh #switch to ksh
$ echo $SHELL #Default shell is still bash
/bin/bash
$ echo $0 #Current shell becomes ksh now
ksh