tags:

views:

220

answers:

5

Duplicate: http://stackoverflow.com/questions/587676/why-do-programs-in-unix-like-environments-have-numbers-after-their-name/

For instance, if I type:

man ps

...and then scroll to the very end I see something like this:

SEE ALSO
     kill(1), w(1), kvm(3), strftime(3), sysctl(8)

How am I supposed to interpret this? I know that kill is another command but what's the meaning of (1)? Is there anything to this?

The git man page is riddle with these:

git-add(1), git-am(1), git-archive(1)

What is someone trying to tell me?

+2  A: 

The man pages are divided into sections, e.g. for system calls, commands, macros etc. mainly to prevent name conflicts, e.g. when a system call has the same name as a command.

One example for this is sleep:

man 1 sleep

versus

man 3 sleep

Section 1 is reserved for user commands.

Konrad Rudolph
+1  A: 

The contents of man are divided into several sections:

  1. Commands available to users
  2. Unix and C system calls
  3. C library routines for C programs
  4. Special file names
  5. File formats and conventions for files used by Unix
  6. Games
  7. Word processing packages
  8. System administration commands and procedures

So kill(1) is about a command but strftime(3) is about a C routine.

Greg
A: 

Man pages are divided into sections. For example section 1 has commands and 2 has system calls.

If you run man kill it finds kill(1) which is the command.

If you run man 2 kill it shows you the system call also named kill.

Same goes for crontab(1) and crontab(5).

sjbotha
+7  A: 

To access the man page for a given numbered section, type man number command

From man man

  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]

So for example,

man 1 printf

Will give you the page for the shell printf command, whereas

man 3 printf

Will give you the page for the C library call.

therefromhere
A: 

As other say, man pages are divided into sections. git-branch(1) refers to the man page named git-branch in the section 1 of manual. You access this specific man page with one of the two commands (depending of your flavour of man):

man 1 git-branch

or

man -s 1 git-branch

Moreover, some items can appear in several sections, with different meanings, e.g., printf(1) and printf(3). Typing:

man printf

displays man page for the first item found, depending of the order of your MANPATH environment variable. You can reorder MANPATH for changing your priority of sections or use:

man -a printf

for displaying all man pages for printf.

mouviciel