Why are Unix applications documented with an number in parenthesis with man?
When I try to get help on a Unix command, I get reference to say tar(1)
or lsof(8)
.
Why is there a number within parenthesis and what does it refer to exactly ?
The manual is divided into chapters and some topics are actually documented twice, which is often the case when there is a C library function or system call that is also available as a user space command or a config file is available with the same name as the command it documents (example: chown
is a user space command and a system call and you find chown
in section 1 and 2). The number is then used to select the appropriate chapter:
man 1 ls
- Section 1: user commands
- Section 2: system calls
- Section 3: library functions
- Section 4: special files
- Section 5: file formats
- Section 6: games
- Section 7: conventions and miscellany
- Section 8: administration and privileged commands
- Section L: math library functions
- Section N: tcl functions
Yep, what SvW said. You can get the full doc from man itself by typing:
$ man 1 man
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 conven-
tions), e.g. man(7), groff(7)
8 System administration commands (usually only for root)
9 Kernel routines [Non standard]