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.

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

I see functions referred to with numbers in the parenthesis in documentation. What does this mean? It takes one argument? Sorry, noob.

share|improve this question
1  
I'm a little disappointed that this was closed as a duplicate, since although both questions have the same answer, they approach it from different sides. –  Ignacio Vazquez-Abrams Feb 6 '12 at 6:02
add comment

marked as duplicate by Michael Mrozek Feb 6 '12 at 5:43

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.

1 Answer

up vote 5 down vote accepted

Unix manual pages come in "sections"; see man man for what they mean (on most platforms; I assume yours will document it in there.)

Section 1 is "user commands", and that means "the manual page from section 1 for ls".

You will find that crontab(1) and crontab(5) are an example of where you have more than one page under a single name in different sections.

To access it from the command line run man 1 ls, or man 5 crontab.

You can also use man -a crontab to go through the page of that name in all sections where it is present.

(Why is this? Because when man pages are printed as books, the sections are how the content breaks down into useful references. Not that you often see that any more, but way back when...)

Depending on the operating system the sections are broken down differently, Wikipedia's entry for man page has a nice explanation. But for instance, on BSD, Linux and UNIX - section '3' is reserved for library functions (particularly those in the standard C library). So if you're writing C code you can fine-tune your section lookup to make results a bit quicker. man 2 printf, or man -s 2 printf yields the C version and keeps you from having to wade through the man page for /usr/bin/printf which would otherwise come up first since section one will yield a hit first.

Man Page Section List for BSD, Linux, UNIX variants: (by way of wikipedia)

  1. General commands
  2. System calls
  3. Library functions, covering in particular the C standard library
  4. Special files (usually devices, those found in /dev) and drivers
  5. File formats and conventions
  6. Games and screensavers
  7. Miscellanea
  8. System administration commands and daemons
share|improve this answer
    
Well, it's still useful to be able to separate e.g. crontab the command from crontab the config file. –  Ignacio Vazquez-Abrams Feb 6 '12 at 5:10
add comment

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