6

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 ?

voretaq7
  • 79,345
  • 17
  • 128
  • 213
Erick
  • 181
  • 1
  • 5

2 Answers2

20

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
Sven
  • 97,248
  • 13
  • 177
  • 225
  • 1
    Man page section layouts also vary between implementations as well, with the numbering and ordering differing slightly between System V Unix, Solaris, and Linux distros. Some man pages have additional sections depending on if an installed package or program also installs its man pages. – inetplumber Sep 19 '13 at 01:32
4

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]
voretaq7
  • 79,345
  • 17
  • 128
  • 213
itzo
  • 79
  • 2