2 ms·
The (1) and (5) and so on are the section of "the manual" that is being referred to; "the manual" referring to the entire system manual, and the one command you
by LukeShu 6y ago
The (1) and (5) and so on are the section of "the manual" that is being referred to; "the manual" referring to the entire system manual, and the one command you're looking up being just one page in that manual (hence "man page").
As for what those sections are, `man man` tells me (my system gets this man page from the "man-db" project https://www.nongnu.org/man-db/ https://www.nongnu.org/man-db/ ; your system may use a man page of different authorship, but it should tell you roughly the same thing):
The table below shows the section numbers of the manual followed
by the types of pages they contain.
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, e.g. /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]
Sometimes the number has a suffix; for example, the "p" suffix as in (1p) or (3p) indicates that the man page is taken from POSIX (and therefore might be missing features that your version has; but also that everything in it can probably be relied on on other systems). Or (3perl) which indicates that it's a Perl library function instead of a C library function.
You can tell `man` which section you're looking in like `man 5 passwd`. This is useful for looking up passwd(5) which describes the /etc/passwd file, rather than passwd(1) which describes the `passwd` command to change your password. Or `man 2 signal` to describe the "signal" system-call instead of the signal(3p) libc function, or `man 7 signal` to get an overview and listing of signals.