CentOSDebianFedoraHow ToLinuxOperating SystemsRedHatUbuntu

[How To] Find the current working shell

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.

Related Articles

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to top button