Book HomeLinux in a NutshellSearch this book

Chapter 6. The Linux Shells: An Overview

Contents:

Purpose of the Shell
Shell Flavors
Common Features
Differing Features

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, "bash: The Bourne-Again Shell", and Chapter 8, "csh and tcsh". (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:

6.1. Purpose of the Shell

There are three main uses for the shell:

6.1.1. 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.

6.1.2. 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, for execution immediately after login.

6.1.3. Programming

A series of individual commands (be they shell or other Linux commands available on the system) combined into one executable file is called a shell script. Batch files in MS-DOS are a similar concept. bash is considered a powerful programming shell, while scripting in csh is rumored to be hazardous to your health.



Library Navigation Links

Copyright © 2001 O'Reilly & Associates. All rights reserved.

This HTML Help has been published using the chm2web software.