Skip to main content
p. 26

2.13 Getting Online Help

Linux systems come with a wealth of documentation. For basic commands, the manual pages (or man pages) will tell you what you need to know. For example, to see the manual page for the ls command, run man as follows:

$ man ls

Most manual pages concentrate primarily on reference information, perhaps with some examples and cross-references, but that’s about it. Don’t expect a tutorial, and don’t expect an engaging literary style.

When programs have many options, the manual page often lists the options in some systematic way (for example, in alphabetical order), but it won’t tell you what the important ones are. If you’re patient, you can usually find what you need to know in the man page. If you’re impatient, ask a friend—or pay someone to be your friend so that you can ask him or her.

To search for a manual page by keyword, use the -k option:

$ man -k keyword
p. 27

This is helpful if you don’t quite know the name of the command that you want. For example, if you’re looking for a command to sort something, run:

$ man -k sort
--snip--
comm (1) - compare two sorted files line by line
qsort (3) - sorts an array
sort (1) - sort lines of text files
sortm (1) - sort messages
tsort (1) - perform topological sort
--snip--

The output includes the manual page name, the manual section (see below), and a quick description of what the manual page contains.

note

If you have any questions about the commands described in the previous sections, you may be able to find the answers by using the man command.

Manual pages are referenced by numbered sections. When someone refers to a manual page, they often put the section number in parentheses next to the name, like ping(8). Table 2-3 lists the sections and their numbers.

Table 2-3: Online Manual Sections

SectionDescription
1User commands
2Kernel system calls
3Higher-level Unix programming library documentation
4Device interface and driver information
5File descriptions (system configuration files)
6Games
7File formats, conventions, and encodings (ASCII, suffixes, and so on)
8System commands and servers

Sections 1, 5, 7, and 8 should be good supplements to this book. Section 4 may be of marginal use, and Section 6 would be great if only it were a little larger. You probably won’t be able to use Section 3 if you aren’t a programmer, but you may be able to understand some of the material in Section 2 once you’ve read more about system calls in this book.

Some common terms have many matching manual pages across several sections. By default, man displays the first page that it finds. You can select a manual page by section. For example, to read the /etc/passwd file description (as opposed to the passwd command), you can insert the section number before the page name like so:

$ man 5 passwd
p. 28

Manual pages cover the essentials, but there are many more ways to get online help (aside from searching the internet). If you’re just looking for a certain option for a command, try entering a command name followed by --help or -h (the option varies from command to command). You may get a deluge (as in the case of ls --help), or you may find just what you’re looking for.

Some time ago, the GNU Project decided that it didn’t like manual pages very much and switched to another format called info (or texinfo). Often this documentation goes further than a typical manual page does, but it can be more complex. To access an info manual, use info with the command name:

$ info command

If you don’t like the info reader, you can send the output to less (just add | less).

Some packages dump their available documentation into /usr/share/doc with no regard for online manual systems such as man or info. See this directory on your system if you find yourself searching for documentation—and, of course, search the internet.