Home > Articles

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

Read a Command's Specific Man Page

man [1-8]

You might notice in the previous listing that the first line of man's page on ls references LS(1), while earlier, when you used the -k option, all the names of commands were also followed by numbers in parentheses. Most of them are 1, but one, lsof, is 8. So what's up with all of these numbers?

The answer is that man pages are categorized into various sections, numbered from 1 to 8, which break down as follows (and don't worry if you don't recognize some of the example, as many of them are pretty arcane and specialized):

  1. General commands. Examples are cd, chmod, lp, mkdir, and passwd.
  2. Low-level system calls provided by the kernel. Examples are intro and chmod.
  3. C library functions. Examples are beep, HTML::Parser, and Mail::Internet.
  4. Special files, such as devices found in /dev. Examples are console, lp, and mouse.
  5. File formats and conventions. Examples are apt.conf, dpkg.cfg, hosts, and passwd.
  6. Games. Examples are atlantik, bouncingcow, kmahjongg, and rubik.
  7. Miscellanea, including macro packages. Examples are ascii, samba, and utf-8.
  8. System administration commands used by root. Examples are mount and shutdown.

Almost every command we've looked at so far in this book falls into section 1, which isn't surprising because we're focused on general use of your Linux system. But notice how some commands fall into more than one section: chmod, for instance, is in both 1 and 2, while passwd can be found in 1 and 5. By default, if you enter man passwd in your shell, man defaults to the lower number, so you'll get the section 1 man page for passwd, which isn't very helpful if you want to learn about the file passwd. To see the man page for the file passwd, follow man with the section number for the data you want to examine.

$ man passwd
PASSWD(1)                            PASSWD(1)
NAME
  passwd - change user password
SYNOPSIS
  passwd [-f|-s] [name]
  passwd [-g] [-r|-R] group
  passwd [-x max] [-n min] [-w warn] [-i inact]
login
  passwd {-l|-u|-d|-S|-e} login
DESCRIPTION
  passwd changes passwords for user and group accounts. A normal user...
[Listing condensed due to length]
$ man 5 passwd
PASSWD(5)                            PASSWD(5)
NAME
  passwd - The password file
DESCRIPTION
  passwd contains various pieces of information for each user account.
[Listing condensed due to length]
  • + Share This
  • 🔖 Save To Your Account