Chapter 2. Getting Help

The man Command

The Unix operating system was one of the first to include online documentation. It’s not the best in the world — most users who haven’t internalized the manual set curse it once a week — but it has proven surprisingly resilient. What’s particularly interesting about Unix’s online documentation is that, unlike other early help systems, it isn’t an adjunct to another set of printed documentation that contains the “real” truth. The online manual is complete, authoritative, and usually more current than any printed documentation.

The basis for Unix’s online documentation is the man command. Most simply, you use it as follows:

% man 
               topic

where topic is usually the name of some command; but it can also be the name of a system call, a library routine, an I/O device, or an administrative file (or file type). The output from man is usually sent to a pager like more, which allows you to page through the results.

There are several command-line options for the man command that can differ based on system. For instance, to look at a command within a specific section, on a System V machine use the -s “section” option, with the following format:

% man 
               section topic
% man -s 
               section topic

For example, if you want to read documentation about the /etc/passwd file (rather than the passwd command) on a System V machine, give the command:

% man -s 4 passwd

This is an easy way to distinguish between topics with the same name, but in different sections. For other Unix ...

Get Unix Power Tools, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.