O'Reilly logo

Linux in a Nutshell, Fourth Edition by Aaron Weber, Stephen Figgins, Ellen Siever

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

Purpose of the Shell

There are three main uses for the shell: interactive use, customizing your Linux session, and 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.

Customizing 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, or interactively for a single session. Startup files can also contain Linux or shell commands, for execution immediately after login.

Programming

A series of individual commands (be they shell commands 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 tcsh is rumored to be hazardous to your health.

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