Introduction

A shell is a program that takes commands typed by the user and calls the operating system to run those commands. For example, you may use the shell to enter a command to list the files in a directory, such as ls, or a command to copy a file, such as cp. A shell acts as a form of wrapper around the operating system, hence the term shell.

Unix and Linux systems support many different kinds of shells, each with its own command syntax. You can run a shell window to enter shell commands from a graphical desktop environment.

Shell scripts combine commands together and act similarly to batch files. With a shell and shell scripts, you can customize your system, automate tedious daily tasks, better perform your work, and get more out of your computers.

No matter how nice a graphical user interface your system sports, adding the power of a shell can dramatically increase the speed and efficiency of what you can do on your computer. Shells provide greater control over your system and allow you to do some things that simply cannot be done from the graphical environment. Shells often allow you to perform tasks remotely, which proves useful if you need to do something to a large number of computers, or computers located at another site.

Furthermore, Apple Computer chose Unix, an inherently scriptable operating system, as the basis for Mac OS X. In the Macintosh environment, you get the ability to create scripts along with a really neat desktop user interface.

As many small devices grow ...

Get Beginning Shell Scripting now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.