Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question
1  
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
5  
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
add comment

5 Answers

up vote 9 down vote accepted

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
share|improve this answer
1  
Thanks a lot @Lekensteyn! –  Some Noob Student Nov 13 '11 at 21:41
add comment

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.

share|improve this answer
2  
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
    
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
add comment

man 2 accept will display section 2, for example.

share|improve this answer
add comment

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
share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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