In Unix, what is the shell?
The shell is a program that interprets commands and acts as an intermediary between the user and the inner workings of the Unix system. Providing a command-line interface (i.e., the shell prompt or command prompt), the shell is analogous to DOS and serves a purpose similar to graphical interfaces like Windows, Mac OS, Mac OS X, and the X Window System.
On most Unix systems, there are several shells available. For the
average user, they offer similar functionality, but each has different
syntax and capabilities. Most shells fall within one of two classes:
those descended from the Bourne shell (i.e., sh), which
first appeared in Version 7 Unix, and those that arose from
the C Shell (i.e., csh), which made its debut in
BSD. Nearly every Unix system has these two shells
installed, but may also have several others, including:
| Shell |
Class |
Description |
Korn shell (ksh) |
sh |
An extension of the Bourne shell with several features adapted from the C shell; the POSIX shell is based on the Korn shell |
TC shell (tcsh) |
csh |
A revision of the C shell with substantially expanded capabilities; the default shell in modern BSD implementations, including Mac OS X/Darwin |
Bourne-again shell (bash) |
sh |
An extension of the Bourne shell, but with unique features; part of the GNU project and the default shell for Linux |
For more information, see In Unix, where can I get information on differences between the various shells? You may find out what
options you have for your login shell (i.e., your default shell) by
looking at the file /etc/shells.
Most shells double as interpreted programming languages. To automate tasks, you may write scripts containing built-in shell and Unix commands. When you execute a script, the shell interprets these commands just as if you had entered them from the command-line prompt. Compared to compiled programs, shell scripts are slow, but easy to write and debug.
Note: In general, shells of the Bourne shell class are better for scripting than those derived from the C shell.
To Unix, the shell is nothing more than another program. For this
reason, any program can be designated a login shell in
/etc/shells. For example, some Emacs users
pride themselves on never needing a traditional shell prompt.
Also see:
- From Pine, how do I exit to the Unix shell without quitting the program?
- In Unix, what startup and termination files do the various shells use?
- In Unix, where can I get information on differences between the various shells?
- In Unix, what are the two main classes of shells?
- At IU, where can I find TeX and LaTeX on the UITS central systems?
- In Unix, what is chsh, and how do I use it to change my shell?
Last modified on April 09, 2008.






