Linux Tips & Tricks · October 7, 2021

Man section 2

[Linux] What Are The Man Section Numbers?

Man… The one and only man.. The M in the RTFM… As you know, “man” command shows manual pages in Linux. Man pages are separated into man sections and man section numbers have their own meanings.

When you open up a man page, you’ll see a number inside parentheses at the upper left corner. Like the image above taken from a man page of a system call. What’s that number mean? It shows you section of the man page you’re looking.

There are 9 types of man sections:

  1. Executable programs or shell commands
  2. System calls (functions provided by the kernel)
  3. Library calls (functions within program libraries)
  4. Special files (usually found in /dev)
  5. File formats and conventions eg /etc/passwd
  6. Games
  7. Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7)
  8. System administration commands (usually only for root)
  9. Kernel routines [Non standard]

Below, you’ll see a few examples.

ls” is an executable program. So it’s man page will be in section 1:

Man section 1
Man section 1

On the other hand, even “useradd” is an executable program too, it’s a system administration tool. Therefore, it’ll be in section 8:

Man section 8
Man section 8

What about Steam? That’s right, games. So, section 6:

Man section 6
Man section 6

But why do I need this information? Why do I need to know man section numbers? Well, sometimes you’ll be doing everything that man page suggested, but it’ll never work as you wish. Are you sure looking into the right manual page?

How to list all man sections of a command?

By using “man -f command“, you can list all available man sections of given command:

[root@localhost ~]# man -f crontab
crontab (1)          - maintains crontab files for individual users
crontab (5)          - files used to schedule the execution of programs

So as you can see, there are 2 man pages for “crontab“. One is in section 1, the one we’ll be looking for the usage of crontab command. But section 5 will give us information about the crontab file itself.

To call a specific man section, you can simply add the section number after man, like “man 5 crontab“:

Man section 5
Man section 5

Look at the image above. Notice the cron(8). You have to refer to section 8 of the man page of cron to get more information.