Linux – How to find out which Shell you are using?

Here are three quick ways to find out which shell you are currently using:

Method 1:


# echo $SHELL



Method 2:


# echo $0



Method 3:


# ps -p $$


 PID TTY               TIME CMD
1447 tty1          00:00:01 bash
About these ads

, ,

  1. #1 by dinesh on May 7, 2013 - 11:08 pm


  2. #2 by Meagan on February 17, 2013 - 3:22 am

    Wow that was strange. I just wrote an really
    long comment but after I clicked submit my comment didn’t show up. Grrrr… well I’m
    not writing all that over again. Regardless, just wanted to say
    wonderful blog!

  3. #3 by unknown on August 22, 2012 - 11:15 am

    good info..

  4. #4 by akismet-a78e4ca2265737c53b15b0970a135976ens on August 1, 2012 - 10:56 am

    hey, how do you know the shell of another user?

  5. #5 by anshprat on December 4, 2008 - 4:11 am

    #! /bin/ksh
    echo $SHELL

    will still give me bash. How do I get the desired output in this case, i.e, ksh? I want to know the shell under which the process is running..

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

%d bloggers like this: