O'Reilly logo

Linux in a Nutshell, 6th Edition by Robert Love, Stephen Figgins, Ellen Siever, Arnold Robbins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. The Bash Shell

The shell is a program that acts as a buffer between you and the operating system. In its role as a command interpreter, it should (for the most part) act invisibly. There are three main uses for the shell: interactive use; customizing your Linux session by defining variables and startup files; and programming, by writing and executing shell scripts.

The original Bourne shell became the standard shell for writing shell scripts. The Bourne shell is still found in /bin/sh on Linux systems but is now usually a symbolic link to Bash. Because the Berkeley C shell (csh and later tcsh) offered better features for interactive use, such as command history and job control, for a long time the standard practice was to use the Bourne shell for programming and the C shell for daily use. David Korn at Bell Labs enhanced the Bourne shell by adding csh-like features; his shell is known as the Korn shell (ksh).

The Free Software Foundation developed a clone of the Bourne shell, written from scratch, named “Bash,” the Bourne-Again SHell. Over time, Bash has become a POSIX-compliant version of the shell, incorporating many popular features from other shells, such as csh, tcsh, and ksh. Bash is the primary shell for Linux.

Another popular shell is the Z Shell, zsh, which is similar to ksh but with many extensions. zsh differs from Bash both in being based on ksh and because it does not attempt to be POSIX-compliant the way Bash does.

This chapter covers Bash. All references are ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required