Linux comes with a wide variety of shells. Shell provides a command-line interface to your OS. Some popular shells are bash, sh, Zsh, tcsh, csh and ksh. In this article we will find out which shell you are using on your Linux system and also the default shell on your Linux system and how many shells are installed in your system.
Check how many shells are installed on Linux
Open the terminal app (ctrl+alt+t) and run blow command to find out all installed shells on your Linux system first.
cat /etc/shells
Which shell am I using?
Open the terminal command-line application using the ctrl+alt+t keys and run below command. It will show the currently using shell on your Ubuntu Linux system.
echo $0
You can also check the shell using ps command. In the terminal app run below command.
ps
Another way to find out currently used shell.
sh -c 'ps -p $$ -o ppid=' | xargs -I'{}' readlink -f '/proc/{}/exe'
Another method using grep command.
grep "^$USER" /etc/passwd
Find my Default Shell
To find the default shell, run below command in the terminal. Sometime currently running shell may not be the default shell.
echo $SHELL
That’s it.