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:
- Executable programs or shell commands
- System calls (functions provided by the kernel)
- Library calls (functions within program libraries)
- Special files (usually found in /dev)
- File formats and conventions eg /etc/passwd
- Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7)
- System administration commands (usually only for root)
- 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:
On the other hand, even “useradd” is an executable program too, it’s a system administration tool. Therefore, it’ll be in section 8:
What about Steam? That’s right, games. So, 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“:
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.