How to Check Which Shell You Are Using

command line

I read that terminal is nothing but shell, and Unix provides different flavors of shells:

  • Bourne shell (sh)
  • C shell (csh)
  • TC shell (tcsh)
  • Korn shell (ksh)
  • Bourne Again shell (bash)

Questions:

  • When I open a terminal window, which shell is opened by default?
  • How do I check how many shells are installed?
  • How do I change the shell used from my account?

Best Answer

You can type the following command in your terminal to see which shell you are using:

echo $0

The result will look something similar to the below if you are using the bash (Bourne Again Shell) terminal:

-bash