Which shell am I using - how to check

Nov 21, 2021 · 1 min read · Post a comment
Which shell am I using - how to check

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

Example output:


Find the current shell you are working on.

$ echo $0

Example output:


Or, alternatively:

$ ps -p $$

Example output:

PID  TTY           TIME  CMD
2167 ttys001    0:00.30  -zsh

List currently installed shells.

$ cat /etc/shells

Example output:



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.