Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

So, for example, when I type man ls I see LS(1). But if I type man apachectl I see APACHECTL(8) and if I type man cd I end up with cd(n).

I'm wondering what the significance of the numbers in the parentheses are, if they have any.

share|improve this question
add comment

5 Answers

up vote 89 down vote accepted

The number corresponds to what section of the manual that page is from; 1 is user commands, while 8 is sysadmin stuff. The man page for man itself (man man) explains it and lists the standard ones:

MANUAL SECTIONS
    The standard sections of the manual include:

    1      User Commands
    2      System Calls
    3      C Library Functions
    4      Devices and Special Files
    5      File Formats and Conventions
    6      Games et. Al.
    7      Miscellanea
    8      System Administration tools and Deamons

    Distributions customize the manual section to their specifics,
    which often include additional sections.

There are certain terms that have different pages in different sections (e.g. printf as a command appears in section 1, as a stdlib function appears in section 3); in cases like that you can pass the section number to man before the page name to choose which one you want, or use man -a to show every matching page in a row:

$ man 1 printf
$ man 3 printf
$ man -a printf

You can tell what sections a term falls in with man -k (equivalent to the apropos command). It will do substring matches too (e.g. it will show sprintf if you run man -k printf), so you need to use ^term to limit it:

$ man -k '^printf'
printf               (1)  - format and print data
printf               (1p)  - write formatted output
printf               (3)  - formatted output conversion
printf               (3p)  - print formatted output
printf [builtins]    (1)  - bash built-in commands, see bash(1)
share|improve this answer
    
That certainly explains it. Is there an easy way of telling whether or not there are multiple man pages for a given command? –  Wilduck Oct 28 '10 at 21:46
    
@Wil Yes, edited –  Michael Mrozek Oct 28 '10 at 21:52
    
Note that these section numbers are for Linux. 1, 3 and 6 are the same across all unix variants AFAIK, but the others and the non-lone-digit sections can differ. Usually man X intro describes what is in section X. –  Gilles Oct 28 '10 at 22:31
    
@Giles The single digit sections 1-5 are pretty well standardized across all Unix variants, going back to the original Unix from Bell Labs. –  KeithB Oct 29 '10 at 13:42
2  
@KeithB: I've used some unices with different 4,5,7,8. Digital Unix (OSF1) had, and Solaris still has: file formats in 4, misc in 5, devices in 7. Solaris also puts administrator commands in 1m. I think system calls in 2 is universal, but some systems also have some C library interfaces in 2 (when they're supposed to be thin wrappers around the eponymous syscall). –  Gilles Oct 29 '10 at 20:20
show 1 more comment

The history of these section numbers goes back to the original Unix Programmer's Manual by Thompson and Ritchie in 1971.

The original sections were

  1. Commands
  2. System calls
  3. Subroutines
  4. Special files
  5. File formats
  6. User-maintained programs
  7. Miscellaneous
share|improve this answer
add comment

What is's means already described, but I also wants to add that each section has special manual page with introduction: intro. For example, see man 1 intro or man 3 intro and so on.

share|improve this answer
    
I don't see this on my Fedora install. Is man X intro not standard? –  tjameson Jul 1 '11 at 4:39
    
@tjameson Do you have man-pages package installed? –  php-coder Jul 1 '11 at 4:43
    
I guess not! Thanks, I didn't know about that package. Thanks! –  tjameson Jul 1 '11 at 4:47
add comment

From the man manpage:

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 conven‐
       tions), e.g. man(7), groff(7)
   8   System administration commands (usually only for root)
   9   Kernel routines [Non standard]

As to why they're separate like that -- there's some overlap. Certain manpages exist in more than one section depending on what you mean.

For instance, compare man crontab with man 5 crontab -- chances are the latter is the one you meant to look up.

share|improve this answer
    
And what are man1p and man3p? –  Tyilo Aug 4 '11 at 20:15
    
And where should I place my own manpages located in ~/man? –  Tyilo Aug 4 '11 at 20:20
    
I knew there were different numbers, but I didn't know there was a rhyme to it. Thanks –  user606723 Aug 4 '11 at 20:28
    
1p is the posix standard version of the manual. If you want to write portable code, you should use only Xp man pages. If you implementation is non posix compliant X and Xp man pages could differ. –  andcoz Aug 4 '11 at 22:42
add comment

These are section numbers. Just type man man or open konqueror and type man://man and you'll see what are these sections.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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