12

I'm new with Linux and have noticed that there are numbers beside certain commands I look up.

For example I want to look up accept() in the aspect of network programming, but man accept shows this instead:

accept(8)                   Easy Software Products                   accept(8)

NAME
       accept/reject - accept/reject jobs sent to a destination

So how do you switch between manual pages to other numbers like accept(1) ~ accept(7)?

bwDraco
  • 46,683

5 Answers5

21

To find out which sections are available, use whatis manpage. Example:

$ whatis unlink
unlink (2)           - delete a name and possibly the file it refers to
unlink (1)           - call the unlink function to remove the specified file

To view the manual page in question, use man section manpage, e.g.:

man 2 unlink

Using the -a option, you'll be able to show all sections of a manpage:

man -a unlink

I haven't found a way to "switch" between manpages even though the pager less supports switching (:p and :n), the only supported actions using the -a option are "next", "skip" and "cancel".

When in doubt, you can also read the manual page of man:

man man
Lekensteyn
  • 6,982
17

The 8 referenced there isn't actually page 8, it is section 8. The sections are split like this:

Section     Description
1   General commands
2   System calls
3   C library functions
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

So the accept you are reading about is the system admin command.

If a command is in more than one section, you will be prompted for the one you want, or you can use:

man 8 accept

Where "8" is the section. This will target the specific man page section you are after.

Paul
  • 61,193
5

man 2 accept will display section 2, for example.

Mike Scott
  • 4,501
4

FYI, For less-forgiving *NIX environments (Mac/Darwin, Solaris, AIX, ... ) may not accept

man 2 accept

you would need to use -S 2 instead:

man -S 2 accept
DouglasDD
  • 470
2

The simplest way is to run

man -a name

This will show in sequence all the manual pages for "name" in all volumes where they appear.

jlliagre
  • 14,369