Chapter 3. Using the Shell

The use of a shell command interpreter (usually just called a shell) dates back to the early days of the first UNIX systems. Besides their obvious use of running commands, shells have many built-in features such as environment variables, aliases, and a variety of functions for programming.

There are several different shells to choose from on Mac OS X systems. In the past, tcsh was used as the default shell. More recently, the Bourne Again Shell (bash) has been the default.

This chapter offers information that will help you use most UNIX shells, in general, and the bash shell, in particular.

Terminal Windows and Shell Access

The most common way to access a shell from a Mac OS X graphical interface is using a Terminal window. To open a Terminal window from Mac OS X, open the Applications folder and select Utilities

Terminal Windows and Shell Access

The commands shown in Figure 3-1 illustrate that the current shell is the bash shell (/bin/bash); the current user is the desktop user who launched the window (myerman), and the current directory is that user's home directory (/Users/myerman). The username (myerman) and the shell (bash) appear in the title bar.

The Terminal window not only enables you to access a shell; it also has controls for managing your shells. For ...

Get MAC OS® X UNIX® Toolbox: 1000+ Commands for the Mac OS® X 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.