Discovering what shell you're using

When you first log in to your UNIX account, you'll be using the default shell on your system. The default shell, its features, and its options depend completely on what your system administrator specifies. Code Listings 3.1 and 3.2 show examples of how default shell prompts differ on two different systems.

To discover what shell you're using:

  • echo $SHELL

    At your shell prompt, type echo $SHELL (capitalization counts!). This command tells UNIX to display (echo) information about shell settings. This information, by the way, is part of the environment variables, so the technical phrasing (which you might hear in UNIX circles) is to "echo your shell environment variable."

    The system's response will be the full path to your shell—something like /bin/csh, /bin/bash, or /bin/ksh. Code Listings 3.1 and 3.2 show you how two different UNIX systems respond.

Tip

You can also use finger userid, substituting your login name for userid, to find out more about your shell settings. You can substitute any other userid and see comparable information about the other account holders. See Chapter 7 for more about finger.


Tip

You'll find more information about different shells and their capabilities throughout this chapter.


Code Listing 3.1. Our ISP account uses the /bin/csh shell by default.
xmission> echo $SHELL
/bin/csh
xmission> finger ejray
Login name: ejray
   In real life: "RayComm
Directory: /home/users/e/ejray
   Shell: /bin/csh
On since Jul 23 06:58:48 on pts/16 from
  calvin.raycomm.com
1 minute 28 seconds Idle Time
No unread mail
No Plan.
xmission>

Code Listing 3.2. On hobbes, a Linux system, the default shell is /bin/bash.
[ejr@hobbes ejr]$ echo $SHELL
/bin/bash
[ejr@hobbes ejr]$ finger ejr
Login: ejr
   Name: Eric J. Ray
Directory: /home/ejr
   Shell: /bin/bash
On since Wed Jul 22 07:42 (MDT) on tty1
   3 hours 15 minutes idle
On since Thu Jul 23 08:17 (MDT) on ttyp0 from
   calvin
No mail.
Project:
Working on UNIX VQS.
Plan:
This is my plan--work all day, sleep all
   night.
[ejr@hobbes ejr]$

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.207.129