[How To] Find the current working shell

Share with all..

Sometimes working from command line might require to know which shell you are currently using. To find out the current working shell, below steps will be helpful:

Try below command first:

ps -p $$

Output:

PID TTY          TIME CMD
 2248 pts/8    00:00:00 bash

Another command which also works on MAC OS and other Linux distributions:

echo $0

Output:

-bash

The above commands work on RHEL, CentOS, Ubuntu, Fedora, Mac OS and Debian.


Share with all..

About Abhijit Sandhan

Loves Open Source, Blogging, Traveling, Hiking and sharing Knowledge!

Leave a Reply

Your email address will not be published. Required fields are marked *