What shell am I using on Unix?

Question:
How to check the shell being used on a Unix system

To check the shell currently being used on a Unix system enter:

echo $0  

or

ps -p $$  

The above always returns the current shell as the above prints the current process.

What's the difference between the shell currently being used and the shell assigned to the user?

To check the shell assigned to your user account enter:

  echo "$SHELL"

Please note that $SHELL is the shell assigned to your user account during the login process but not necessarily the shell that is running at the moment. This is because you could have executed a new shell, for example by entering:

sh

or

bash
Taxonomy: