The Linux Application Development Web site, http://ladweb.net, has updates to this book’s text, detailed information beyond this book’s scope, and pointers to more information on the Internet.
Access the system reference manual pages (man pages) through the man
command. To read the reference page on the man
command itself, run the command line man man
. Man pages generally contain reference documentation, not tutorial information, and are renowned for being so succinct that they are barely understandable at times. Nevertheless, when you need reference material, they can be exactly what you want.
Three programs provide access to man pages. The man program displays individual man pages, and the apropos
and whatis
commands search for a keyword in the set of man pages. The apropos
and whatis
commands search the same database; the difference is that whatis
displays only lines that match exactly the word you are searching for, and apropos
displays any line that contains the word you are searching for. That is, if you are looking for man, apropos
matches manager
and manipulation
, whereas whatis
matches only man
separated from other letters by white space or by punctuation, as in man.config
. Try the commands whatis man
and apropos man
to see the difference.
Many of the man pages on a Linux system are part of a large package assembled by the LDP. In particular, the section 2 (system calls), section 3 (libraries), section 4 (special, or device, files), and section 5 (file formats) pages are mainly from the LDP’s man-pages collection and are generally the pages most useful for programming. If you want to specify which section to look in, give the number of that section before the name of the man page you want to read. For example, man man
gives the man page for the man
command from section 1; if you want to see the specification for how to write man pages, you need to specify section 7 with man 7 man
.
While you are reading man pages, remember that many system calls and library functions use the same names. In most cases, you want to know about the library functions to which you will be linking, not about the system calls that those library functions eventually call. Remember to use man 3
function
to get the descriptions of library functions, because some library functions have the same names as system calls in section 2.
Also, be particularly aware that the C library man pages are maintained separately from the C library itself. Since the C library does not usually change behavior, that is not usually a problem. All the Linux distributions now use the GNU C library, introduced in Chapter 6. The GNU C library comes with full documentation, which is maintained with the library. This information is available in Texinfo form.
The GNU project has adopted the Texinfo format for its documentation. Texinfo documentation can be printed (using a conversion to TEX) or read online (in the “info” format, a very early hypertext format that preceded the World Wide Web). There are many programs for reading the info documentation in Linux. Here is a small selection.
The Emacs editor has an info reading mode; type [ESC] X info
to enter this mode.
The info
and pinfo
programs are small text-mode programs for browsing info pages.
Most system documentation programs (such as the GNOME yelp
and KDE khelpcenter
programs) are capable of displaying info pages. We recommend these tools, as they generally provide a hypertext interface to the info pages that is more familiar to anyone who is comfortable using a Web browser than the interface presented by Emacs, info
, or pinfo
. (These tools also present other system documentation such as man pages and documentation for the system they are part of.)
The /usr/share/doc
directory provides a catch-all location for otherwise uncollected documentation. Most packages installed on your system install “README” files, documentation in various formats (including plain text, PostScript, PDF, and HTML), and examples under the /usr/share/doc directory. Each package has its own directory, which is named for the package and generally carries the package version number as well.
13.59.139.220