Выбрать главу

4.2. Accessing Online Documentation

A fully loaded Fedora system includes over 4,700 programs, plus programming interfaces, data files, and graphical tools. To help you learn your way around, over 12,000 files of online documentation are available, with additional documentation available through the Web. Knowing how to access and knowledgeably navigate through this documentation is essential to getting the most out of your Fedora system.

The phrase online documentation refers to both local and Internet-based electronic documentation.

4.2.1. How Do I Do That?

There are five main types of documentation available:

 Manpages

info pages

 The GNOME Guides and KDE Manuals

 HOWTOs and guides from the Linux Documentation Project

 Text files distributed with applications

4.2.1.1. Using manpages

Fedora continues the Unix tradition of providing an online version of what were originally loose-leaf printed manuals. These manuals cover the commands, programming interfaces, and data formats used by the system.

The command used to access these online manuals is called man , so these documents have come to be known as manpages . The majority of Fedora documentation is in this format.

The pages are arranged into sections according to the original binders, using the section numbers described in Table 4-2 . The section numbers are used to distinguish different manpages with the same name, such as the manpage for the uname system call (found in section 2) and the uname command (found in section 1). In some cases, a letter or two may be appended to a section number to indicate a subsection (such as 3pm , the manual section containing Perl module library functions).

A system call is a request made of the operating system by an application program. 

Table 4-2. Section numbers for manpages

Section Description
1 User commands
2 System calls
3 Library functions
4 Special files
5 File formats
6 Games
7 Conventions and miscellany
8 Administration and privileged commands

To view the manpage for a particular command, such as ls :

$ man ls

The output will appear as shown in Figure 4-1 . You can use the up and down arrow keys and the Page Up/Page Down keys to scroll through the text, or q to quit. You can also type / , enter some text, and press Enter to search for that text within the document; type n (lowercase n , for next ) to search again. ? and N (uppercase N ) can be used in the same way to search backwards.

Figure 4-1. Online display of a manpage

To request a manpage from a specific section of the manual, give the section as the first argument and the name of the manpage as the second argument:

$ man 2 uname

If you don't specify the section, the first section containing a page with the requested name is usedand since there is a uname page in section 1, you won't see the page from section 2 unless you specifically ask for it.

4.2.1.2. Finding a manpage

The -k argument of man is used to produce a list of all of the pages that contain a specific keyword in their short descriptions. For example, if you wanted to see all of the manpages that contained the word calendar in their summary:

$ man -k calendar

Date::Calc (3pm) - Gregorian calendar date calculations

Date::Calendar (3pm) - Calendar objects for different holiday schemes

Date::Calendar::Profiles (3pm) - Some sample profiles for Date::Calendar and

Date::Calendar::Year

Date::Calendar::Year (3pm) - Implements embedded year objects for Date::Calendar

cal (1) - displays a calendar

Note that the section number is in parentheses. If you were looking for a calendar command, you could ignore the results from section 3 of the manual (library functions), which leaves just one possibility: the cal command. You could then get more information about that command to see if it will do what you need :

$ man cal

apropos is another name for man -k. To my ear, it has more class! 

To see all of the manpages with a specific name in all sections of the manual, use the whatis command:

$ whatis uname

uname (1) - print system information

uname (2) - get name and information about current kernel

In this case, you can see that there is a page for uname in section 1 and 2 of the manual.

4.2.1.3. Reading info documents

The GNU project supplies most of its documentation in info documents rather than manpages. info documents are a unique form of hypertext and are read with a reader program named, not surprisingly, info :

$ info ls

info has many features and can be a bit overwhelming. Each document consists of nodes (analogous to web pages) that are linked together using menu options. The keys listed in Table 4-3 are sufficient for basic navigation.

Table 4-3. Basic navigation in info

Key Description
Page Up/Page Down Scroll through the text.
p Go to the previous node.
n Go to the next node.
Tab Jump to the next menu option in the current page.
Enter (when the cursor is on a menu option) Follow the menu option.
Space Go to the next page, or next node if there is no more text in the current node.
l Return to the last node accessed.