Understanding Shells and Options

Depending on the particular Unix system you're using, you may have several shells available to you. Table 3.1 describes a few of the more common ones. Each of these shells has slightly different capabilities and features. Keep in mind that the differences in shells do not affect what you can do in Unix; rather, they affect how easily and flexibly you can interact with the system.

Table 3.1. Common Unix Shells




This shell, which is the original Unix shell (often called the Bourne shell), is fine for scripting but lacks a lot of the flexibility and power for interactive use. For example, it doesn't have features like command completion, email checking, history, or aliasing.

csh and tcsh

This family of shells adds great interactive uses but discards the popular scripting support that sh-related shells offer in favor of a C programming-like syntax. Because of the C syntax, this shell is often just called the C shell. Unless you're a C programmer, these are not likely to be your best choices.

ksh, bash, and zsh

These provide a good blend of scripting and interactive capabilities, but they stem from different sources (bash is most similar to sh, hence the Bourne Again SHell name).

You'll likely have bash, ksh, or tcsh (csh)as your shell, but you can change to one of many other shells fairly easily. As Code Listings 3.3 and 3.4 show, you can start by finding out which shells are available to you. Figure 3.1 shows some shells and how they relate to each other.

Figure 3.1. Shells fit neatly into a few "families" with the exception of a few stragglers. Each shell in a family shares many characteristics with the others in the same family.

To see which shells are available to you:

  • cat /etc/shells

    At the shell prompt, type cat /etc/shells to find out which shells are available to you. Code Listings 3.4 and 3.5 show the results of this command on two different systems.


  • Before you go leaping forward through the next sections and changing your shell, you might check with your system administrator or help desk to find out which shells they support and sanction.

  • If all else is equal in terms of support from your system administrator or help desk, and you have no clear preference, we'd suggest zsh as a first choice, with bash as a close second. For most purposes, either will be fine. Power users will like zsh better in the long run.

  • Not all systems use /etc/shells to list acceptable shells--you may have to just look for specific shells, as shown later in this chapter.

Code Listing 3.3. A minimal listing of available shells on a Unix system, including the basics but not too much in the way of choices.

[ejr@hobbes]$ more /etc/shells /bin/bash /bin/sh /bin/tcsh /bin/csh [ejr@hobbes]$ 

Code Listing 3.4. These shells are available through an ISP. Notice the additional, custom shells that this ISP uses, including shells that provide special features such as not allowing logins.

xmission> cat /etc/shells /usr/local/bin/tcsh /bin/csh /usr/bin/csh /bin/ksh /usr/bin/ksh /sbin/sh /usr/bin/sh /usr/local/bin/zsh /usr/local/bin/bash /usr/local/bin/nologin /usr/local/bin/terminated /usr/local/bin/xmmenu.email /usr/local/bin/xmmenu.noshell /usr/lib/uucp/uucico xmission> 

Unix(c) Visual Quickstart Guide
UNIX, Third Edition
ISBN: 0321442458
EAN: 2147483647
Year: 2006
Pages: 251

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net