Chapter 6. The Linux Shells: An Overview

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. It also can be used for simple programming.

This section introduces three shells commonly used on Linux systems—the Bourne-Again shell (bash), the C shell (csh), and csh’s enhanced version, tcsh—and summarizes the major differences between them. Details on them are provided in Chapter 7, and Chapter 8. (Some Linux distributions also offer the Korn shell, ksh, another popular version of the Bourne shell with some of the same features as bash.)

The following topics are presented in this chapter:

  • Purpose of the shell

  • Shell flavors

  • Common features

  • Differing features

Purpose of the Shell

There are three main uses for the shell:

  • Interactive use

  • Customization of your Linux session

  • Programming

Interactive Use

When the shell is used interactively, it waits for you to issue commands, processes them (to interpret special characters, such as wildcards), and executes them. Shells also provide a set of commands, known as built-ins, to supplement Linux commands.

Customization of Your Linux Session

A Linux shell defines variables, such as the locations of your home directory and mail spool, to control the behavior of your session. Some variables are preset by the system; you can define others in startup files that your shell reads when you log in. Startup files also can contain Linux or shell commands, ...

Get Linux in a Nutshell, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.