Terminal Tips and Tricks

After you’ve used Terminal awhile, you may feel ready for a few of these power tips:

Split Windows

If you choose Window→Split Pane (⌘-D), you wind up splitting your Terminal window into an upper pane and a lower pane. That can be handy when you keep certain scripts running all the time. The two panes mirror the same command, but now you can scroll to different positions within each pane, keeping watch over different parts of the same output simultaneously.

From the left side, choose the service you want; from the right, choose from a list of machines whose Remote Login checkboxes are turned on in the Sharing panel of System Preferences. Type your account name into the User box. As you adjust the connection options, the box at the bottom shows the Unix command you’re building. Click Connect to open a new Terminal window and send that command inside it.

Figure 16-9. From the left side, choose the service you want; from the right, choose from a list of machines whose Remote Login checkboxes are turned on in the Sharing panel of System Preferences. Type your account name into the User box. As you adjust the connection options, the box at the bottom shows the Unix command you’re building. Click Connect to open a new Terminal window and send that command inside it.

Switching Windows

You can switch among your various Terminal windows by pressing ⌘-1, ⌘-2, and so on (up to ⌘-9). You’ll be able to identify the windows easily if you choose to include the Command key in the title bars. (Use the Window section of the Settings Preference pane.)

Noncontiguous Selection

You can select blobs of text, just as in Microsoft Word or TextEdit. To select a single rectangle of text anywhere in the window, Option-drag through it. To select multiple rectangles, Option-⌘-drag. You can ...

Get Mac OS X Lion: The Missing Manual 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.