Mac OS X Unleashed

Mac OS X Unleashed

By John Ray and William C. Ray

Using Terminal.app

The Terminal program, found in the utilities subfolder of the Applications folder, is the primary method for communicating with the BSD subsystem of the OS X installation, via the Unix command line. Some tricks and nifty applications are already appearing to insulate you from the need to work with the command line for some applications. We will cover these as well, but the terminal itself will probably be your primary mode of interaction.

Simply put, Terminal.app is the "terminal" by which you can type commands to your machine. It's the software version of what used to be implemented as a dedicated hardware device that understood how to display data and put it in specific positions on a screen. A terminal itself isn't particularly interesting, but provides the mechanism for communication between you and programs that are more interesting to talk to.

Terminal Preferences

As with most OS X GUI tools, a number of things about Terminal.app can be customized. Because you're probably familiar with configuring GUI apps by now, we'll just hit the highlights and give you an overview of what is configured where.

Across the top of the preferences panel, you have a number of panes from which to choose. These include

The Save and Save As items are accessible from the Shell menu. These allow you to save the setup and preferences of a Terminal.app window or window set.

Also accessible are the Save Text As and Save Selected Text As items. These allow you to save the complete text buffer of the terminal, or whatever text you have selected in the terminal. The Run Command option of the Shell menu produces the dialog box in which you can enter a command to run in a new terminal window.

If the command doesn't produce an interactive environment, the new window will just tell you that the command ran, which isn't very useful. If the command is an interactive one such as emacs (emacs is a very powerful text editor that you'll learn about in Chapter 15, "Command-Line Applications and Application Suites"), it will produce a new window and run the specified command in that window.

The Shell menu item Set Title seems like a preferences option. In fact, if you select it, you get yet another way to control the window's behavior. This menu item and the Inspector menu item bring up the Terminal Inspector, which gives you access to most of the same preferences options as the preferences panel. The biggest difference seems to be that the Terminal Inspector and Preferences panel are different shapes.

Most of the items in the Edit menu are familiar. The Find item, however, leads to an option to bring up the Find panel, from which you can search for data in the Terminal's buffer.

The Font and Windows menus have the properties you already expect, and the Control menu shows you the options you have for cursor control in the window. Additionally, this menu includes the option to send a Break signal to the terminal, which can be invaluable for stopping a program that has gone awry without taking the drastic step of closing the terminal.

Share ThisShare This

Informit Network