A shell is a sophisticated way to control your computer—Unix, Linux, Microsoft Windows,
Mac OS X, and others. If you do more than the most basic operations, you can do many of them
more powerfully and quickly with a shell and your keyboard than by using a mouse.
The history of shells goes back some 30 years. In the early days of the Unix operating system,
choosing and customizing your interface to a computer was a new idea. (It still is new to many
people today, users of “one-size-fits-all” window systems that can be changed only superficially.)
Before windows and a mouse were common, programmers began developing an interface that
used the keyboard: typing one or a few words to run programs, then reading results from the
same screen. As time went on, more shells were developed, giving users more choices.
New features have been added continually over the years, making the modern shell an
incredibly rich environment that saves power users hours of time and frustration. Tasks that
take lots of repetitive work with a mouse can be automated. For example, shell features such as
completion let you accomplish a lot with little typing.
A shell can work in two ways. You can use it interactively to do things by hand. You can also
automate a task by packaging those same operations into a script or function. Learning shell
features lets you do both of those because a shell is a user interface and a programming language in
The shells we discuss run on many operating systems. What you learn about shells will let
you use all of these operating systems in the same way. If you use more than one operating
system, a shell gives you a powerful and familiar interface to all of them.
There are several major shells. Because each has its differences, covering all of the shells
could make a book that’s both confusing and unwieldy. We’ve concentrated on bash and zsh,
two of the most modern and powerful shells. Both are freely available; in fact, they’re installed
on many of the systems we’ve listed and can be downloaded from the Internet for the rest.