A.1. Manual Page Sections

The online manual pages found in Linux provide a wealth of information. The manual pages are loosely grouped by category into the following sections:

  1. User commands and application programs.
  2. System calls. A complete list of system calls can be found at the end of this appendix.
  3. Library functionsthese functions do not directly invoke kernel primitives.
  4. Devices.
  5. File formats.
  6. Games and demonstrations .
  7. Special conventions and protocols, character set standards, the standard file system layout, and a variety of other miscellaneous things.
  8. Administrative and privileged commands available only to the superuser.
  9. Device drivers and kernel interfaces.
  10. New.

There are a variety of ways to access manual page information. The most standard approach is to use the man utility on the command line. For example, almost every section has a manual page called intro that provides an overview of the section. To obtain the proper intro manual page for a section, the section number is passed on the command line when the man command is invoked. For example, the intro manual page for Section 2 (system calls) is specified as

linux$ man 2 intro

On the command line a manual page can be sent to the printer using the command sequence

linux$ man 2 intro col -b lp

In this sequence the output of the man command is piped to the col utility. This utility, when passed the -b option, filters out any backspaces and outputs only the last character written to each column position. The output of the col utility is then piped to lp for printing.

Another approach is to use the info utility. This program, which is a document-reading utility, helps to facilitate manual page navigation and access to related topics. The command line sequence

linux$ info info

brings up the manual page on the info utility. On our Linux system this brings up the following screen.

File: info.info, Node: Top, Next: Getting Started, Up: (dir) Info: An Introduction ********************* Info is a program, which you are using now, for reading documentation of computer programs. The GNU Project distributes most of its on-line manuals in the Info format, so you need a program called "Info reader" to read the manuals. One of such programs you are using now. If you are new to Info and want to learn how to use it, type the command 'h' now. It brings you to a programmed instruction sequence. To learn advanced Info commands, type 'n' twice. This brings you to 'Info for Experts', skipping over the 'Getting Started' chapter. * Menu: * Getting Started:: Getting started using an Info reader. * Advanced Info:: Advanced commands within Info. * Creating an Info File:: How to make your own Info file. * Index:: An index of topics, commands, and variables.

Entering the letter h at this first screen displays the basics of how to use this utility. Entering the letter q quits (exit) the info utility.

Even another approach is to use xman , the X Window System manual browser. For example, on our Linux system entering the command sequence

linux$ setenv MANPATH /mit/kit/man:/usr/share/man linux$ xhost+ linux$ xman &

assigns the environment variable MANPATH (used by xman ) the directory locations to be searched, [1] disables access control (allowing X Window clients to connect from any host), and invokes xman , placing it in the background. On the client a small X Window similar to the one below is displayed.

[1] Things get a bit dicey here as they vary somewhat from system to system. Check the file /etc/man.config for specifics about the content of the MANPATH variable. In any case, when using xman , be sure to add /mit/kit/man to the directories to be searched.

Selecting [Help] displays a window with online help, [Quit] terminates service, and [Manual Page] displays a window containing a manual page browser. Entering [Ctrl] + [S] after selecting [Manual Page] generates a text entry box where the name of a specific command can be entered.

The file /etc/man.config is a text based file that holds the default customization specifications for the man utility. Contained in this file are a variety of uppercase identifiers which are assigned values. These identifiers parallel corresponding environment variables used by the man utility. The values assigned to the identifiers in the man.config file act as the default values if the corresponding environment variable has not been set. Aside from MANPATH another item of passing interest is the value assigned to MANSECT. MANSECT stipulates which manual sections are to be searched and their order. On our system when initially configured MANSECT is set to:

MANSECT 1:8:2:3:4:5:6:7:9:tcl:n:l:p:o

This is fine from an administrative viewpoint. However, if you are doing a great deal of programming you might want to change the default order by moving section 8 (administrative and privileged commands) further back in the sequence and placing section 2 (system calls) and 3 (library functions) nearer the front. One such rearrangement would be:

MANSECT 3:2:1:4:5:6:7:8:9:tcl:n:l:p:o

Категории