The Bourne shell is one of the oldest shells still in use on modern Linux systems, even though it's not as widely used as Bash. Here's what you need to know about the Bourne shell on Linux.

What Is the Bourne Shell?

The Bourne shell, often abbreviated to "sh," is named after the British computer scientist Stephen R. Bourne, who developed it while working at Bell Labs in 1978. The shell replaced the earlier Thompson Shell, written by one of Unix's original creators, Ken Thompson.

The Bourne shell debuted with Version 7 Unix in 1979. It had features like flow control, variables, and improved string handling. These features made it easier to use the shell as a programming language rather than just a way to call up other programs.

While the Bourne shell remained popular for writing portable scripts across Unix systems, it was superseded for interactive use by the C shell, KornShell, Bourne Again shell, also known as Bash, and Z shell. These shells offered features like command history and command-line editing that made life easier fsor users and administrators.

KornShell, Bash, and Z shell (covered later) have syntaxes influenced by the Bourne shell.

More powerful cross-platform scripting languages with even more advanced features like Perl and Python also largely replaced shell scripting.

Still, the Bourne shell is widely understood and a lot of scripts supplied with Linux programs use its syntax for various tasks.

The Bourne shell's behavior was codified into the POSIX standard, so many modern Unix-like systems implement it in some way by using a compatible shell.

Modern Bourne Shell Alternatives

There are several open-source modern alternatives to the original Bourne shell on Linux systems. Here are some of the best-known:

1. Bourne Again Shell (Bash)

The name Bourne Again shell (Bash) is a play on the Bourne shell. This shell was originally developed as a component of the GNU system, predating Linux for several years.

It's largely compatible with scripts originally written for the Bourne shell. It also incorporated features like command-line editing pioneered by KornShell.

Bash is the default shell on many Linux distributions and thus has become a de facto standard on its own.

2. KornShell

KornShell, also known as ksh, was originally developed by David Korn, also at Bell Labs, in the 1980s. Built on top of Bourne shell, KornShell introduced some additional features like job control, arrays, and command-line editing. The latter was a revolutionary feature when it first appeared because it was a lot easier than using the C shell's history mechanism.

If you needed to re-edit a previously issued command, you could use commands similar to Vi or Emacs to do it.

KornShell was a default on some commercial Unix systems like Oracle Solaris. As the original KornShell was initially released by AT&T under a proprietary license, an open-source version named pdksh was eventually released.

3. Almquist/Debian Almquist Shell

The Almquist shell was originally written by Kenneth Almquist and was intended as a lightweight replacement for the Bourne shell. Many BSD systems include it as the implementation of sh.

A version was ported to Debian in the 1990s and is known as the Debian Almquist shell. As the name implies, it's the implementation of sh on Debian and Ubuntu systems.

4. Z Shell

Z shell, or zsh, is one of the newest shells, originally developed in 1990 by Paul Falsted. Z shell has become well-known for its advanced features. A good example is recursive globbing, or the ability to match wildcards in subdirectories.

Z shell is the default login shell for macOS and Kali Linux.

Bourne Shell Compatibility

ls -l command in Debian showing /bin/sh symlinked to dash

While these shells are largely compatible with scripts originally written for the Bourne shell, there are ways to change their behavior to be more like the original shell.

The main way of doing this is through a symbolic link. Most systems will symlink /bin/sh to either Bash or another shell. When invoked this way, the shell will enter a compatibility mode with the Bourne shell.

You can see which shell /bin/sh is linked to with the ls command:

        ls -l /bin/sh
    

Now You Know About the Bourne Shell

The Bourne shell is one of the oldest standards for scripting on Unix-like systems. Even if it's been replaced by other shells, it's still vital for running scripts written by others.

Bash is one of the best Bourne derivatives for coding, particularly for its approach to variables. It has some unique variables that may make you want to consider it for your next project.