Types of Shells in Linux
Types of Shells in Linux
In Linux and Unix, a shell refers to a program that is used to interpret the typed
commands the user sends to the operating system. The closest analogy in Windows is the
DOS Command Prompt. However, unlike in Windows, Linux and Unix computers allow
the user to choose what shell they would like to use.
Bourne Shell
The original Bourne shell is named after its developer at Bell Labs, Steve Bourne. It was the first
shell used for the Unix operating system, and it has been largely surpassed in functionality by
many of the more recent shells. However, all Unix and many Linux versions allow users to
switch to the original Bourne Shell, known simply as "sh," if they choose to forgo features such
as file name completion and command histories that later shells have added.
sh: The Bourne shell, or sh, was the default Unix shell of Unix Version 7, and replaced the
Thompson shell, whose executable file had the same name, sh. It was developed by Stephen
Bourne, of AT&T Bell Laboratories, and was released in 1977 in the Version 7 Unix release
distributed to colleges and universities. It remains a popular default shell for Unix accounts. The
binary program of the Bourne shell or a compatible program is located at /bin/sh on most Unix
systems, and is still the default shell for the root superuser on many current Unix
implementations.
C Shell
The C shell, as its name might imply, was designed to allow users to write shell script programs
using a syntax very similar to that of the C programming language. It is known as "csh."
csh: The C shell (csh) is a Unix shell developed by Bill Joy for the BSD Unix system. It was
originally derived from the 6th Edition Unix /bin/sh (which was the Thompson shell), the
predecessor of the Bourne shell. Its syntax is modeled after the C programming language. The C
shell added many feature improvements over the Bourne shell, such as aliases and command
history. Today, the original C shell is not in wide use on Unix; it has been superseded by other
shells such as the Tenex C shell (tcsh) based on the original C shell code, but adding filename
completion and command line editing, comparable with the Korn shell (ksh), and the GNU
Bourne-Again shell (bash).
TC Shell
TC shell is an expansion upon the C shell. It has all the same features, but adds the ability to use
keystrokes from the Emacs word processor program to edit text on the command line. For
example, users can press Esc-D to delete the rest of the highlighted word. It is also known as
"tcsh."
tcsh: tcsh (pronounced “TC-Shell” or “T-shell”) is a Unix shell based on and compatible with
the C shell (csh). It is essentially the C shell with (programmable) filename completion,
command-line editing, and a few other features.
Korn Shell
Korn Shell was also written by a developer at Bell Labs, David Korn. It attempts to merge
the features of the C shell, TC shell and Bourne shell under one package. It also includes the
ability for developers to create new shell commands as the need arises.
It is known as "ksh."
ksh: The Korn shell (ksh) is a Unix shell which was developed by David Korn (AT&T Bell
Laboratories) in the early 1980s. It is backwards compatible with the Bourne shell and
includes many features of the C shell as well, such as a command history, which was inspired
by the requests of Bell Labs users. The main advantage of ksh over the traditional Unix shell
is in its use as a programming language. Since its conception, several features were gradually
added, while maintaining strong backwards compatibility with the Bourne shell.
Almquist shell
ash: The Almquist shell (also known as A Shell or ash) was originally Kenneth Almquist’s clone
of the SVR4-variant of the Bourne shell; it is a fast, small, POSIX-compatible Unix shell
designed to replace the Bourne shell in later BSD distributions. By intention it did not feature
line editing or command history mechanisms originally, because Almquist felt that such should
be moved into the terminal driver. Current variants have emacs and vi modes.
Z shell
zsh: The Z shell (zsh) is a Unix shell that can be used as an interactive login shell and as a
powerful command interpreter for shell scripting. Zsh can be thought of as an extended bourne
shell with a large number of improvements, including some of the most useful features of bash,
ksh, and tcsh.