Linux Training

Linux training for private, public & voluntary sector.

0800 024 8425

City LinUX Training Courses

Section 8.
Linux shells
.


"In fact, we started off with two or three different shells and the shell had life of its own."

Ken Thompson.

8. The Linux shell.

Although shells enable operating system like activities, they are user processes like any other. Any number of shells can co-exist on Unix/Linux system and many are provided as standard.

8.1. sh - Bourne shell.

The default shell for UNIX Version 7, written by Stephen Bourne at Bell Labs. Became the predominant Systems V shell from ATT. The Bourne shell and it’s successors have continued to be the shell of choice for most systems administrators.

8.2. dash - fast shell.

The Bourne shell has recently come back from the dead, re-incarnated as dash but with a symbolic link to sh which is how it is normally used.

Extensions to sh found in the ksh and bash and which have been designated by POSIX have been incorporated but the shell is designed to be smaller, mores stable and faster (hence dash) than the Bourne Again Shell. It is described as the "standard command interpreter" for some systems including Ubuntu although it is not the default shell for user accounts.

8.3. bash - Bourne Again Shell.

Created by Brian Fox for the FSF, the Bourne Again Shell incorporated the features from the csh and ksh. On most Linux systems it is the default shell that is set for a user when their account is created.

8.4. csh - C shell.

The Csh developed by Bill Joy at UCB became the BSD default shell and tended to be most favoured by programmers. The csh had sophisticated features such as history and job control but was regarded as buggy for many years.

8.5. ash - Almquist Shell.

The successor to the csh as the default BSD shell is ash, a really lightweight clone of sh developed by Kenneth Almquist. Ash is commonly used in embedded Linux implementations such as the Android phone.

8.6. zsh.

Created by Paul Falstead in 1990 at Princeton the zsh (Zong Shao) has the most enigmatic name and some of the most sophisticated features, including spelling correction, loadable modules, themed prompts, full TCP and domain socket controls, FTP and multi line editing.

8.7. ksh - Korn Shell.

The Korn shell developed by David Korn at Bell Labs in 1980s incorporated many of the advanced features of the C-shell into the Bourne shell. I used the ksh extensively in the AIX environment which sought to be POSIX compliant but later found that it was not available in many other unix distributions.

The ksh remained proprietary to AT&T until 2000. Open source versions such as pdksh and mksh were developed in the interim but all became marginalised by the rise of Linux and the Bourne Again Shell (bash) which included many of the features, such as job control and history, that were missing from the original.

Derivatives of the Korn shell include the Desktop Korn Shell (dtksh) developed to incorporate CDE widgets, tksh which includes access to tk widgets and oksh an Open BSD implementation.

8.8. rbash - restricted Bourne Again shell.

Rsh (stet) was often a separate binary from sh but the restricted Bourne Again Shell is a link to bash. Invoking bash as rbash or using the -r flag sets up a more restricted or controlled environment than normal. (see man bash).

8.9. Exercises.

Experiment with using ash, dash and other shells.

Use man to find out about the chsh command and try changing your shell.

Check the value of the environment variable SHELL.


The layout and associated style sheets for this page are taken from the World Wide Web Consortium and used here under the W3C software licence.