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)

       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)?

  • 2
    Nowadays you can read manpages on the web too: linux.die.net/man – ott-- Nov 13 '11 at 21:14
  • @ott Also, Google Chrome has a man pages plugin, so one can type "man popen" and it will automatically load the relevant man page from an online source (eg linux.die.net). – new123456 Nov 13 '11 at 22:21
  • 4
    @ott--: Yes, but any man pages on the web aren't necessarily in sync with the software on your system. – Keith Thompson Nov 13 '11 at 23:03
  • 6
    The man command has its own man page; typing man man would have answered this and many other questions. – Keith Thompson Nov 13 '11 at 23:04

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

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.

  • 3
    I've never been prompted when a name is in more than one section--man has just shown me the first one. You can, though, use the -a option to be taken to all the pages of that name in sequence, or the -k option to see a list of all the pages containing that name in their short descriptions. – garyjohn Nov 13 '11 at 21:24
  • 1
    Thanks @Paul, this helps a lot! Is there a keyboard shortcut to simply switch between sections? – Some Noob Student Nov 13 '11 at 21:28
  • 1
    @Sheldon man is not GNU info - its just a program which prints out manual pages, and does not use a built in explorer. – new123456 Nov 13 '11 at 22:19

man 2 accept will display section 2, for example.


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

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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