3

Possible Duplicate:
What do the numbers in a man page mean?

If I typeman ls, I seeLS(1) in the top left and top right corners of the manpage.

I also see programs on the internet being refered to this way.

ex. man(1), xman(1x), apropos(1), makewhatis(8) and catman(8).

What are these numbers (and in some cases letters)?

2
  • The original Unix manuals came in several binders, numbered 1 for user commands, 2 for system calls, 3 for library functions, 4 for "special files" (devices), 5 for file formats, 6 for games (extremely important! we all know this is the reason for the machine, all the rest is just disguise ;-), 7 for conventions and such. To this they added folder n for new (experimental stuff), and some installations had a l folder for local stuff. For more details on section S do man S intro.
    – vonbrand
    Commented Feb 4, 2013 at 18:12
  • An important thing to note about this is that there may be multiple man pages with the same name in different sections, but you cannot tell that by just asking for man whatever.
    – goldilocks
    Commented Feb 4, 2013 at 19:53

1 Answer 1

4

It's the section number, see

man man

A section, if provided, will direct man to look only in that section of the manual. The default action is to search in all of the available sections, following a pre- defined order and to show only the first page found, even if page exists in several sections.

    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 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]

By example, stat have 3 sections :

$ man -k stat | grep "^stat "
stat (1)             - display file or file system status
stat (2)             - get file status
stat (3p)            - get file status

So if you type

man 1 stat

it's not the same as

man 2 stat
3
  • SysV derived unixen (Solaris for example) have slightly different numbering, see en.wikipedia.org/wiki/Man_page#Manual_sections Commented Feb 4, 2013 at 17:45
  • Every Unix has different sections, regardless of heritage.
    – schaiba
    Commented Feb 4, 2013 at 17:54
  • What is the meaning of the p in stat(3p)?. Also in m4(1p) ? I believe it stands for POSIX but I'm not entirely sure. Commented Aug 25, 2018 at 21:37

Not the answer you're looking for? Browse other questions tagged .