How do you switch between Linux manual pages?
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)
?
Solution 1:
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
Solution 2:
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.
Solution 3:
man 2 accept
will display section 2, for example.