The section numbers
man
will show the manpage from any section, man 7
will show the manpage from section 7. So, here 7 refers to the section of the particular command for which you are looking for the manual page.
A section, if provided, will direct man to look only in that section of
the manual.
The sections
See the following table for the section numbers of the manual followed by the
types of pages they contain.
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 conventions), e.g.
man(7), groff(7)
8: System administration commands (usually only for root). Overviews of various topics, conventions and protocols,
character set standards, and miscellaneous other things.
9: Kernel routines [Non standard]
Commands in more than one section
In most of the cases you will want to use the man
command without additional n. However, in some cases a command will appear in more than one section. For example if you issue the command man open
, you get the man page for openvt from section 1. But if you need to see the man page for open as a C (or system call, as per the above table) command, you need to issue man 2 open
.
A very similar example will be man printf
and man 3 printf
. Please issue the commands and see for yourself the difference in output.
Your issue of man 7 unix
(UNIX(7))
So, that UNIX(7) means that it belongs to section 7.
Which section will be shown by default if I do not provide a section number?
The default action is to search in all of the available
sections, following a pre-defined order and to show only the first page
found, even if page exists in several sections.
How do I know the section number of a command?
Should you need to find out what sections a term/command falls in with man -k
(equivalent to the apropos command). So, man -k printf
will search the short descriptions and manual page names for the keyword printf as regular expression. Print out any matches. (Equivalent to apropos -r printf
). Issue the command, see the ton you get. If need to avoid substring matches, (e.g. it will show sprintf if you run man -k printf
), so you need to use ^term
to limit it, as below,
man -k '^printf'
Printf (3o) - Formatted output functions.
printf (1) - format and print data
printf (3) - formatted output conversion
Related command
A related command is apropos
as indicated above, which searches the manual page names and descriptions. If you are not sure which manual page you are looking for but have a general idea, use this command.