Linux & Servers
[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.


