This question already has an answer here:

What's the significance of the number, like the 2 in STAT(2), seen in man pages?

For example, man 2 stat yields a man page with STAT(2) at the top and a description that begins, The stat() function..., while man stat yields a man page with STAT(1) at the top and a description that begins, The stat utility...

I noticed the page for STAT(1) says BSD General Commands Manual, while that for STAT(2) says BSD System Calls Manual, so maybe the number is a code for the type of command?

marked as duplicate by Ramesh, goldilocks, Anthon, Networker, cuonglm Sep 1 '14 at 15:28

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    Have you checked the manual page for the man command itself (i.e. man man)? – steeldriver Sep 1 '14 at 14:22
up vote 3 down vote accepted

The number is a "section" there are several sections. Usually

1 is General command
2 is System calls
3 is functions (for example in C)
4 is Special Files
5 is File Formats (think config files)
6 is misc.
7 is system commands

The reason is that a "term" may be in many sections. ftp is a command, could be a daemon and might have a config file.

So stat(1) is saying the general command stat, while stat(2) is saying the system call stat. It can be confusing. For normal usage usually you only see 1 and 5. 3, for example is filled with C function calls and such.

  • 8 is system commans, 7 is device, see man 7 intro – Archemar Sep 1 '14 at 14:45
  • it's system dependent. – coteyr Sep 1 '14 at 15:09

In the "good old days", man pages were printed and came with the mainframe/mini computers (took all of them home to read at one point). They came in volumes organized by usage: command, system command, library call, system call, file format, etc. The man(1) page shows the volume names. To view a page from a specific volume, you would put that on the command line before the manpage name: To see stat(2), you would run man 2 stat. Otherwise it takes the first volume that the name is found in, stat(1). To find if there are multiple entries in different volumes, you can use apropos -e stat.

Not the answer you're looking for? Browse other questions tagged or ask your own question.