Tech Forums

How to find out which shell I am using (current shell) in Unix / Linux?

User Rating:  / 0
PoorBest 

After looking on the net for this for quite some time I came across the following solutions to this problem-

1. echo $0

This is the surest way yet to tell which shell you are currently using. The shell you are using is displayed in response. If you see the following on some older versions of UNIX -”no file for $0″ this means you are using the c-shell.

2.echo $shell

In tcsh or C-shell this displays the current shell

3.ps | grep sh
The command with the largest “pid” indicates the current shell. this method is very reliable.

Site Login