+1  A: 

It's to tell you what man page section help is in... 8 is typically the location of Administrative related utilities (/sbin, /usr/sbin, etc.)

So help for GREP(3) is in man page section 3, and you could type man 3 grep to get the help for grep(3) directly.

John Weldon
+5  A: 

The number indicates which section the manpage is in. For your examples:

grep(3)

To get the documentation, type

man 3 grep

More commonly, if there is no grep(2) or grep(1), you can get away with

man grep

However, I should note that grep is in section 1. Section 3 is generally reserved for C functions. An example is getopt: getopt(1) refers to the command-line utility getopt, but getopt(3) refers to the C function getopt. Likewise, read(1) is a program that reads from standard input, but read(2) is a POSIX system call for use in programs - it is one of the lowest-level forms of input you can get on most Linux (and other Unix) systems.

Chris Lutz
Not all versions of "man" support an unadorned section name. Solaris in particular would think you're asking about a command named 3. Use the "-s" option to remove doubt. It also has sections that aren't just numbers, including 3c and 3socket.
Rob Kennedy
+14  A: 

If you run man man you will see the following information in the man page:

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]

Some names are associated with multiple entries, eg on my system 'sleep' has an entry in section 1 and an entry in section 3. You can specify the one you want with e.g.

man 3 sleep

Sometimes I just guess with

man -a sleep

which displays each entry associated with sleep in turn. I just go through them until I find the one I want. You can also try

man -k sleep

to get a slightly bigger listing of pages involving the term 'sleep'

leif
+1 I would mention that grep is (1), not (3), but you've got an explanation of what's usually where, so that's probably close enough.
Chris Lutz
It's possible that a system could have a grep(3) installed. You are right that the command line grep that we know and love is grep(1).
leif