16.5. Terminal s Window Preferences

 <  Day Day Up  >  

16.4. Online Help

Mac OS X comes with over 900 Unix programs like the ones described in this chapter. How are you supposed to learn what they all do?

Fortunately, almost every Unix program comes with its own little help file. It may not appear within an elegant, brushed-metal Tiger window ”in fact, it's pretty darned plain ”but it offers much more material than the regular Mac Help Center.

These help files are called user -manual pages, or manpages , which hold descriptions of virtually every command and program available. Mac OS X, in fact, comes with manpages on about 7,000 topics ”over 10,000 printed pages' worth.

Alas, manpages rarely have the clarity of writing or the learner-focused approach you find in the Mac Help Center. They're generally terse, just-the-facts descriptions. In fact, you'll probably find yourself needing to reread certain sections again and again. The information they contain, however, is invaluable to new and experienced Unix fans alike, and the effort spent mining them is usually worthwhile.

16.4.1. Using man

To access the manpage for a given command, type man followed by the name of the command you're researching . For example, to view the manpage for the ls command, enter: man ls .

Figure 16-7. To move on to the next man screen, press the Space bar. To go back, press the up arrow key or the B key. To close the manual and return to a prompt, press Q. You can also search for a certain phrase by typing a / (to produce the "find what?" prompt); thereafter, type n to find the next occurrence.



Tip: The -k option flag lets you search by keyword. For example, man -k appletalk producesa list of all manpages that refer to AppleTalk, whereupon you can pick one of the names in the list and man that page name.

Now the manual appears, one screen at a time, as shown in Figure 16-7.

A typical manpage begins with these sections:

  • Name . The name and a brief definition of the command.

  • Synopsis . Presents the syntax of the command, including all possible options and arguments, in a concise formula. For example, the synopsis for du (disk usage) is as follows : du [-H -L -P] [-I mask] [-a -s -d depth] [-c] [-h -k] [-x] [file ] .

    This shows all the flags available for the du command and how to use them.

    Brackets ([ ]) surround the optional arguments. ( All of the arguments for du are optional.)

    Vertical bars called pipes () indicate that you can use only one item (of the group separated by pipes) at a time. For example, when choosing options to use with du , you can use either -H, -L, or -P ”not two or all three at once.

    POWER USERS' CLINIC
    . term Files

    Once you've got a few windows open ”your main Terminal window, a couple of man (user-manual) windows, a top window showing all the running programs (Section 17.3.1.4), and so on ”you may get dizzy just looking at the seas of black-on-white type. One easy solution is to customize the colors, fonts, and positions of your favorite windows, and then make Terminal take a snapshot of that configuration.

    A Terminal .term file stores the size , location, and visible/invisible status of all windows that are open when you create the .term file. It also stores each window's preference settings, including its Font, Title Bar, and Colors settings. (It doesn't store any text in these windows.) Once you've saved a startup file, you can open it again anytime to replicate your saved window layout in Terminal.

    To create a .term file, choose Terminal Window Settings. Set up your preferences the way you like them, and then choose File Use Settings as Defaults. Then open and arrange Terminal windows the way you like them , using the Terminal Inspector, if you like, to make different settings for different windows.

    Next, choose File Save. Use the pop-up menu in the Save dialog box to choose whether you want to save the settings for only the Main window (the active window) or for all windows. In this same dialog box, you can also choose to have the saved .term file opened when Terminal launches. (If so, the settings stored with the .term file override any settings you've made in the Terminal Inspector.)

    You can even include a command line for Terminal to run when this .term file is opened. Just click "Execute this command," type the command into the box, and, if you want the Terminal window to stay opened when the command's done, also turn on "Execute command in a shell."

    The best place to store .term files is in your home directory's Library/Application Support/Terminal folder. (You may have to create the Terminal directory yourself.) Files saved there appear automatically in the File Library menu for quick access.


    The word file in the synopsis means "type a pathname here." The ellipsis ( ) following it indicates that you're allowed to type more than one pathname.

  • Description . Explains in more detail what the command does and how it works. Often, the description includes the complete list of that command's option flags.

For more information on using man , view its own manpage by entering ”what else? ” man man .


Tip: The free program ManOpen, available for download at www.missingmanuals.com, is a Cocoa manual-pages reader that provides a nice looking, easier-to-control window for reading manpages.Or, since you're obviously a Tiger maven, why not just use Dashboard? Download the *Nix Manual widget (from this book's "Missing CD" page at www.missingmanuals.com, for example). It provides an equally attractive interface to the man pages.

Figure 16-8. To access the Terminal Inspector, choose Terminal Window Settings (or press c-I). This window is like a Preferences dialog box with many panes, which you navigate by choosing from the pop-up menu at the top. Two of its panels are shown here.


16.4.2. Other Online Help

Sometimes Terminal shoves a little bit of user-manual right under your nose ”when it thinks you're having trouble. For example, if you use the mkdir command without specifying a pathname, mkdir interrupts the proceedings by displaying its own synopsis as a friendly reminder (subtext: "Um, this is how you're supposed to use me"), like this: usage: mkdir [-pv] [-m mode] directory

 <  Day Day Up  >  


Mac OS X. The Missing Manual
Mac OS X Snow Leopard: The Missing Manual (Missing Manuals)
ISBN: 0596153287
EAN: 2147483647
Year: 2005
Pages: 506
Authors: David Pogue

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net