Linux comes with support for multiple flavors of shell, including bash, zsh, ksh, csh, and so on. This time I’ll be focusing on how to find out which shell you are using, which is the default one and list of all installed shells.
- Shell environment
Find the default shell:
$ echo $SHELL
Find the current shell you are working on:
$ echo $0
$ ps -p $$
PID TTY TIME CMD 2167 ttys001 0:00.30 -zsh
List currently installed shells:
$ cat /etc/shells
/bin/csh /bin/dash /bin/ksh /bin/sh /bin/tcsh /bin/zsh /usr/local/bin/pwsh-preview /usr/local/bin/pwsh
As always, hope this was super handy and If you can think of any other methods to list the current or the default shell environment, please let me know. Feel free to leave a comment below and if you find this tutorial useful, follow our official channel on telegram.