What shell am I using?

Sep 25, 2009 - 2 Comments

I’ve gotten this question multiple times and the answer to what shell you are using is easily discovered by typing the following command at the command line:

echo $SHELL

This command works across all unix platforms, whether it’s Mac OS X, Linux, or whatever. The command will report back something like:

/bin/bash or /bin tcsch

For the vast majority of Mac OS X users, you will be using the Bash shell by default. You can set it to another shell you want rather easily by changing the preferences inside the Mac Terminal.

Related articles:

Posted by: David Mendez in Ask OS X Daily, Command Line

2 Comments

» Comments RSS Feed

  1. Matteo Corti says:

    Hi,

    this is not always true and you should not rely on it. From the bash man page:

    SHELL The full pathname to the shell is kept in this environment variable.
    If it is not set when the shell starts, bash assigns to it the full
    pathname of the current user’s login shell.

    This means that if it is already set a new shell will not replace the value on startup.

    tcsh and ksh behave the same way:

    $ echo $SHELL
    /bin/bash
    $ tcsh
    % echo $SHELL
    /bin/bash
    % ksh
    > echo $SHELL
    /bin/bash

    Matteo

  2. DistortedLoop says:

    Strangely enough, when I open a terminal window in OS X, it says “Terminal – bash – 80×24″ right along the title bar.

    I don’t recall if I set those items in the past, so perhaps they are the OS X default, but they are controlled in Terminal by opening the Preferences and clicking on Window. Here you can title the window bar with your own text, and then there are check boxes for various other things like the active process (your shell name if idle).

Leave a Reply

 

Shop for Apple & Mac Deals on Amazon.com

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

Shared on Facebook

Shop at Amazon

Ad

OSXDaily on Facebook