10.1 Documentation


You might want to know the options to the programs we've introduced and get more information about them and the many other Unix programs. You're now ready to consult your system's documentation and other resources.

10.1.1 The man Command

Different versions of Unix have adapted Unix documentation in different ways. Almost all Unix systems have documentation derived from a manual originally called the Unix Programmer's Manual . The manual has numbered sections; each section is a collection of manual pages, often called manpages; each program has its own manpage . Section 1 has manpages for general Unix programs such as who and ls .

Mac OS X has individual manpages stored on the computer; users can read them online. If you want to know the correct syntax for entering a command or the particular features of a program, enter the command man and the name of the command. The syntax is:

 man   command   

For example, if you want to find information about the program vi , which allows you to edit files, enter:

 $  man vi  . . $ 

The output of man is filtered through the less pager in Mac OS X by default.

Manpages are displayed using a program that doesn't write the displayed text to Terminal's scroll buffer. This can be quite annoying. Fortunately it's an easy fix: just specify PAGER="more " on the command line, or add the line export PAGER="more " to your ~/.bashrc , and the manpages will be left in the Terminal scroll buffer for later reference.


After you enter the command, the screen fills with text. Press the spacebar or Return to read more, and press q to quit.

Mac OS X also includes a command called apropos , or man -k , to help you locate a command if you have an idea of what it does but are not sure of its correct name. Enter apropos followed by a descriptive word; you'll get a list of commands that might help. To get this working, however, you need to first build the apropos database. This is done when Mac OS X runs its weekly maintenance job, which can be run manually with the following command:

 $  sudo periodic weekly  Password: $ 

Don't be surprised if it takes ten minutes or longer for the periodic command to complete; it's doing quite a lot of work in the background. Once complete, you can use apropos to find all commands related to PostScript, for example, with:

 $  man -k postscript  enscript(1)           - convert text files to PostScript grops(1)              - PostScript driver for groff pfbtops(1)            - translate a PostScript font in .pfb format to ASCII pstopdf(1)            - convert PostScript input into a PDF document 
10.1.1.1 Problem checklist

man says there is no manual entry for the command.

Some commands ” cd and jobs , for example ”aren't separate Unix programs; they're part of the shell. On Mac OS X, you'll find the documentation for those commands in the manual page for bash .

If the program isn't a standard part of your Unix system ”that is, you or your system staff added the program to your system ”there may not be a manual page, or you may have to configure the man program to find the local manpage files.

The third possibility is that you don't have all the manpage directories in your MANPATH variable. If so, add the following to your .bashrc (see Section 4.3 in Chapter 4), then open a new Terminal window for the settings to take effect:

 export MANPATH=/sw/share/man:/sw/man:${MANPATH}:/usr/X11R6/man 

10.1.2 Documentation Via the Internet

The Internet changes so quickly that any list of online Unix documentation we'd give you would soon be out of date. Still, the Internet is a great place to find out about Unix systems. Remember that there are many different versions of Unix, so some documentation you find may not be completely right for you. Also, some information you'll find may be far too technical for your needs (many computer professionals use and discuss Unix). But don't be discouraged! Once you've found a site with the general kind of information you want, you can probably come back later for more.

The premier place to start your exploration of online documentation for Mac OS X Unix is the Apple web site. But don't start on their home page. Start either on their Mac OS X page (http://www.apple.com/macosx/) or their Darwin project home page (http://developer.apple.com/darwin/). Another excellent place to get information about software downloads and add-ons to your Unix world is the Fink project (see Section 9.2 in Chapter 9).

Many Unix command names are plain English words, which can make searching hard. If you're looking for collections of Unix information, try searching for the Unix program named grep . One especially Unix-friendly search engine is Google, at http://www.google.com. Google offers a specialized Macintosh search engine at http://www.google.com/mac and a BSD search engine at http://www.google.com/bsd (which is useful because Mac OS X's Unix personality derives from its BSD heritage).

Here are some other places to try:


Magazines

Some print and online magazines have Unix tutorials and links to more information. Macintosh magazines include MacTech (http://www.mactech.com), MacWorld (http://www. macworld .com), and MacAddict (http://www.macaddict.com).


Publishers

Publishers such as O'Reilly & Associates, Inc. (http://www.oreilly.com) have areas of their web sites that feature Unix and have articles written by their books' authors. They may also have books online (such as the O'Reilly Safari service) available for a small monthly fee ”which is a good way to learn a lot quickly without needing to buy a paper copy of a huge book, most of which you might not need.


Universities

Many schools use Unix-like systems and will have online documentation. You'll probably have better luck at the Computer Services division (which services the whole campus) than at the Computer Science department (which may be more technical).


Mac OS X-related web sites

Many Mac OS X web sites are worthy of note, though they're run by third parties and may change by the time you read this. Mac OS X Apps (http://www.macosxapps.com) offers a wide variety of Aqua applications. Information on Darwin can be found at Open Darwin (http://www.opendarwin.org), and Mac OS X Hints (http://www. macosxhints .com) offers valuable information and hints. One more site well worth a bookmark is O'Reilly's MacDevCenter (http://www.macdevcenter.com/).


User Groups

Apple User Groups are an excellent source of information, inspiration, and camaraderie. To find an Apple User Group near you, see http://www.apple.com/usergroups/.

10.1.3 Books

Bookstores, both traditional and online, are full of computer books. The books are written for a wide variety of needs and backgrounds. Unfortunately, many books are rushed to press, written by authors with minimal Unix experience, and full of errors. Before you buy a book, read through parts of it. Does the style (brief or lots of detail, chatty and friendly or organized as a reference) fit your needs? Search the Internet for reviews; online bookstores may have readers' comments on file.



Learning Unix for Mac OS X Panther
Learning Unix for Mac OS X Panther
ISBN: 0596006179
EAN: 2147483647
Year: 2003
Pages: 88

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