Abstract
| Goal | To resolve problems by using on-line help systems and Red Hat support utilities. |
| Objectives |
|
| Sections |
|
| Lab |
|
An overview of the Linux manual in man page format, including efficient navigation and searching.
After completing this section, students should be able to locate documentation and research answers about commands.
The historical Linux Programmer's Manual, from which man pages originate, was large enough to be multiple printed books. Each contained information for specific types of files, which have become the sections listed below. Articles are referred to as topics, as pages no longer applies.
Table 3.1. Sections of the Linux manual
Section | Content type |
|---|---|
1 | User commands (both executable and shell programs) |
2 | System calls (kernel routines invoked from user space) |
3 | Library functions (provided by program libraries) |
4 | Special files (such as device files) |
5 | File formats (for many configuration files and structures) |
6 | Games (historical section for amusing programs) |
7 | Conventions, standards, and miscellaneous (protocols, file systems) |
8 | System administration and privileged commands (maintenance tasks) |
9 | Linux kernel API (internal kernel calls) |
Manual section 9 is a recent addition to Linux. Not all man section listings reference it.
To distinguish identical topic names in different sections, man page references
include the section number in parentheses after the topic.
For example, passwd(1) describes the command to change passwords,
while passwd(5) explains the /etc/passwd
file format for storing local user accounts.
To read specific man pages, use man topic.
Topic contents display one screen at a time. Use arrow keys for single line scrolling
or the space bar for the next screen. The man command searches
manual sections in a configured order, displaying popular sections first. For example,
man passwd displays passwd(1) by default. To display
the man page topic from a specific section, include the section number argument:
man 5 passwd displays passwd(5).
The ability to efficiently search for topics and navigate man pages is a critical administration skill. The following table lists basic man navigation commands:
Table 3.2. Navigating man pages
| Command | Result |
|---|---|
| Spacebar | Scroll forward (down) one screen |
| PageDown | Scroll forward (down) one screen |
| PageUp | Scroll backward (up) one screen |
| DownArrow | Scroll forward (down) one line |
| UpArrow | Scroll backward (up) one line |
| d | Scroll forward (down) one half-screen |
| u | Scroll backward (up) one half-screen |
/string | Search forward (down) for string in the man page |
| n | Repeat previous search forward (down) in the man page |
| N | Repeat previous search backward (up) in the man page |
| g | Go to start of the man page. |
| G | Go to end of the man page. |
| q | Exit man and return to the command shell prompt |
When performing searches, string allows
regular expression syntax. While simple text
(such as passwd) works as expected, regular
expressions use meta-characters (such as $,
*, ., and
^) for more sophisticated pattern matching.
Therefore, searching with strings which include program expression
meta-characters, such as make $$$, might yield
unexpected results.
Regular expressions and syntax are discussed in Red Hat System Administration II, and in the regex(7) man topic.
A keyword search of man pages is performed using man
-k keyword, which displays
a list of keyword-matching man page topics with section numbers.
[student@desktopX ~]$man -k passwdcheckPasswdAccess (3) - query the SELinux policy database in the kernel. chpasswd (8) - update passwords in batch mode ckpasswd (8) - nnrpd password authenticator fgetpwent_r (3) - get passwd file entry reentrantly getpwent_r (3) - get passwd file entry reentrantly ... passwd (1) - update user's authentication tokens sslpasswd (1ssl) - compute password hashes passwd (5) - password file passwd.nntp (5) - Passwords for connecting to remote NNTP servers passwd2des (3) - RFS password encryption ...
Popular system administration topics are in sections 1 (user commands), 5 (file formats), and 8 (administrative commands). Administrators using certain troubleshooting tools also use section 2 (system calls). The remaining sections are commonly for programmer reference or advanced administration.
Keyword searches rely on an index generated by the mandb(8)
command, which must be run as root. The command runs daily through cron.daily,
or by anacrontab within an hour of boot if out of date.
The man command -K option performs a
full-text page search, not just titles and descriptions like the -k.
A full-text search can use greater systems resources and take more time.
man(1), mandb(8),
man-pages(7), less(1),
intro(1), intro(2), intro(5),
intro(7), intro(8) man pages