What is the predefined order in which man searches sections? [duplicate]
up vote
0
down vote
favorite
This question already has an answer here:
What do the numbers in a man page mean?
8 answers
The description of man
in its own man page contains the statement,
The default action is to search in all of the
available sections following a pre-defined order ("1 n l 8 3 0 2 5 4
9 6 7" by default, unless overridden by the SECTION directive in
/usr/local/etc/man_db.conf), and to show only the first page found,
even if page exists in several sections.
What exactly is meant by "1 n l 8 3 0 2 5 4 9 6 7"?
man gnu
New contributor
LongTP5 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
marked as duplicate by Jeff Schaller, Stephen Kitt, meuh, RalfFriedl, Thomas 2 days ago
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
up vote
0
down vote
favorite
This question already has an answer here:
What do the numbers in a man page mean?
8 answers
The description of man
in its own man page contains the statement,
The default action is to search in all of the
available sections following a pre-defined order ("1 n l 8 3 0 2 5 4
9 6 7" by default, unless overridden by the SECTION directive in
/usr/local/etc/man_db.conf), and to show only the first page found,
even if page exists in several sections.
What exactly is meant by "1 n l 8 3 0 2 5 4 9 6 7"?
man gnu
New contributor
LongTP5 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
marked as duplicate by Jeff Schaller, Stephen Kitt, meuh, RalfFriedl, Thomas 2 days ago
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
The man page of my Windows 10 Ubuntu man is even more confusing than the one posted above: "1 n l 8 3 2 3posix 3pm 3perl 3am 5 4 9 6 7"
– LongTP5
2 days ago
On a side note, you can set your own search order withexport MANSECT=0p:1:2:3:3p:4:5:6:7:8:9:l:s:n
– meuh
2 days ago
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
This question already has an answer here:
What do the numbers in a man page mean?
8 answers
The description of man
in its own man page contains the statement,
The default action is to search in all of the
available sections following a pre-defined order ("1 n l 8 3 0 2 5 4
9 6 7" by default, unless overridden by the SECTION directive in
/usr/local/etc/man_db.conf), and to show only the first page found,
even if page exists in several sections.
What exactly is meant by "1 n l 8 3 0 2 5 4 9 6 7"?
man gnu
New contributor
LongTP5 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
This question already has an answer here:
What do the numbers in a man page mean?
8 answers
The description of man
in its own man page contains the statement,
The default action is to search in all of the
available sections following a pre-defined order ("1 n l 8 3 0 2 5 4
9 6 7" by default, unless overridden by the SECTION directive in
/usr/local/etc/man_db.conf), and to show only the first page found,
even if page exists in several sections.
What exactly is meant by "1 n l 8 3 0 2 5 4 9 6 7"?
This question already has an answer here:
What do the numbers in a man page mean?
8 answers
man gnu
man gnu
New contributor
LongTP5 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
LongTP5 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 2 days ago


Jeff Schaller
36.3k952119
36.3k952119
New contributor
LongTP5 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 2 days ago


LongTP5
31
31
New contributor
LongTP5 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
LongTP5 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
LongTP5 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
marked as duplicate by Jeff Schaller, Stephen Kitt, meuh, RalfFriedl, Thomas 2 days ago
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by Jeff Schaller, Stephen Kitt, meuh, RalfFriedl, Thomas 2 days ago
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
The man page of my Windows 10 Ubuntu man is even more confusing than the one posted above: "1 n l 8 3 2 3posix 3pm 3perl 3am 5 4 9 6 7"
– LongTP5
2 days ago
On a side note, you can set your own search order withexport MANSECT=0p:1:2:3:3p:4:5:6:7:8:9:l:s:n
– meuh
2 days ago
add a comment |
The man page of my Windows 10 Ubuntu man is even more confusing than the one posted above: "1 n l 8 3 2 3posix 3pm 3perl 3am 5 4 9 6 7"
– LongTP5
2 days ago
On a side note, you can set your own search order withexport MANSECT=0p:1:2:3:3p:4:5:6:7:8:9:l:s:n
– meuh
2 days ago
The man page of my Windows 10 Ubuntu man is even more confusing than the one posted above: "1 n l 8 3 2 3posix 3pm 3perl 3am 5 4 9 6 7"
– LongTP5
2 days ago
The man page of my Windows 10 Ubuntu man is even more confusing than the one posted above: "1 n l 8 3 2 3posix 3pm 3perl 3am 5 4 9 6 7"
– LongTP5
2 days ago
On a side note, you can set your own search order with
export MANSECT=0p:1:2:3:3p:4:5:6:7:8:9:l:s:n
– meuh
2 days ago
On a side note, you can set your own search order with
export MANSECT=0p:1:2:3:3p:4:5:6:7:8:9:l:s:n
– meuh
2 days ago
add a comment |
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
It's the "section" of the man
-page - that number in parenthesis following the name, for example ls(1)
.
You could think of the man-pages as a set of actual manuals, divided into several volumes. For example, the 1st "volume" is section 1 which contains ordinary user commands - like ls(1), bash(1) and man(1). Section 8 contains commands for the system administrator - like commands for shutting down the system and install packages. (often commands that can't be used by non-root users.) Section 5 contains file-formats - like how /etc/passwd and /etc/sudo should be formatted. Section 3 contains library-functions for various languages (mostly for C) - like the C-function printf().
Note that some "commands" - like cd
and fg
- are really so-called built-ins in the shell, and don't have their own man-page. Instead they're documented in the man-pages for the particular shell - eg. in the man-page of bash(1). Shells may also provide alternatives to some commands as built-ins, and will usually use these instead of the external command. One example is how bash(1) got a built-in version of kill(1).
From the man-page of man-pages(7):
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)
9 Kernel routines [Non standard]
Sometimes letters or words are added to the number to denote the man-page belongs to a sub-system or package, for example, "x" for X GUI commands like startx(1x), or "tcl" for commands and functions belonging to the Tcl-language. Or even that they're "optional"/"additional" or "alternative" commands - for example, if you got two versions of tar
, one from GNU and one from BSD.
To get a specific section, you can add the section-number to your man-command:
man passwd
returns the passwd-command from section 1 (because section 1 is searched first, and the search then stops)
man 1 passwd
returns the same (but now because we specified section 1)
man 5 passwd
returns the file-format of /etc/passwd from section 5 (because we specified section 5 instead of 1)
To differentiate the two, you would refer to them as passwd(1) and passwd(5) (eg. if you wrote a textbook - or a man-page).
So the search-order makes sense - commands are more often sought than file-formats, not to mention programming libraries and system-calls.
Finally, you should note that different Unix-systems may use slightly different sectioning, for example, I've seen section 7 used for word-processing commands, and section 9 used for games, and I've seen section 9 used as a catch-all for various man-pages not fitting elsewhere.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
It's the "section" of the man
-page - that number in parenthesis following the name, for example ls(1)
.
You could think of the man-pages as a set of actual manuals, divided into several volumes. For example, the 1st "volume" is section 1 which contains ordinary user commands - like ls(1), bash(1) and man(1). Section 8 contains commands for the system administrator - like commands for shutting down the system and install packages. (often commands that can't be used by non-root users.) Section 5 contains file-formats - like how /etc/passwd and /etc/sudo should be formatted. Section 3 contains library-functions for various languages (mostly for C) - like the C-function printf().
Note that some "commands" - like cd
and fg
- are really so-called built-ins in the shell, and don't have their own man-page. Instead they're documented in the man-pages for the particular shell - eg. in the man-page of bash(1). Shells may also provide alternatives to some commands as built-ins, and will usually use these instead of the external command. One example is how bash(1) got a built-in version of kill(1).
From the man-page of man-pages(7):
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)
9 Kernel routines [Non standard]
Sometimes letters or words are added to the number to denote the man-page belongs to a sub-system or package, for example, "x" for X GUI commands like startx(1x), or "tcl" for commands and functions belonging to the Tcl-language. Or even that they're "optional"/"additional" or "alternative" commands - for example, if you got two versions of tar
, one from GNU and one from BSD.
To get a specific section, you can add the section-number to your man-command:
man passwd
returns the passwd-command from section 1 (because section 1 is searched first, and the search then stops)
man 1 passwd
returns the same (but now because we specified section 1)
man 5 passwd
returns the file-format of /etc/passwd from section 5 (because we specified section 5 instead of 1)
To differentiate the two, you would refer to them as passwd(1) and passwd(5) (eg. if you wrote a textbook - or a man-page).
So the search-order makes sense - commands are more often sought than file-formats, not to mention programming libraries and system-calls.
Finally, you should note that different Unix-systems may use slightly different sectioning, for example, I've seen section 7 used for word-processing commands, and section 9 used for games, and I've seen section 9 used as a catch-all for various man-pages not fitting elsewhere.
add a comment |
up vote
2
down vote
accepted
It's the "section" of the man
-page - that number in parenthesis following the name, for example ls(1)
.
You could think of the man-pages as a set of actual manuals, divided into several volumes. For example, the 1st "volume" is section 1 which contains ordinary user commands - like ls(1), bash(1) and man(1). Section 8 contains commands for the system administrator - like commands for shutting down the system and install packages. (often commands that can't be used by non-root users.) Section 5 contains file-formats - like how /etc/passwd and /etc/sudo should be formatted. Section 3 contains library-functions for various languages (mostly for C) - like the C-function printf().
Note that some "commands" - like cd
and fg
- are really so-called built-ins in the shell, and don't have their own man-page. Instead they're documented in the man-pages for the particular shell - eg. in the man-page of bash(1). Shells may also provide alternatives to some commands as built-ins, and will usually use these instead of the external command. One example is how bash(1) got a built-in version of kill(1).
From the man-page of man-pages(7):
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)
9 Kernel routines [Non standard]
Sometimes letters or words are added to the number to denote the man-page belongs to a sub-system or package, for example, "x" for X GUI commands like startx(1x), or "tcl" for commands and functions belonging to the Tcl-language. Or even that they're "optional"/"additional" or "alternative" commands - for example, if you got two versions of tar
, one from GNU and one from BSD.
To get a specific section, you can add the section-number to your man-command:
man passwd
returns the passwd-command from section 1 (because section 1 is searched first, and the search then stops)
man 1 passwd
returns the same (but now because we specified section 1)
man 5 passwd
returns the file-format of /etc/passwd from section 5 (because we specified section 5 instead of 1)
To differentiate the two, you would refer to them as passwd(1) and passwd(5) (eg. if you wrote a textbook - or a man-page).
So the search-order makes sense - commands are more often sought than file-formats, not to mention programming libraries and system-calls.
Finally, you should note that different Unix-systems may use slightly different sectioning, for example, I've seen section 7 used for word-processing commands, and section 9 used for games, and I've seen section 9 used as a catch-all for various man-pages not fitting elsewhere.
add a comment |
up vote
2
down vote
accepted
up vote
2
down vote
accepted
It's the "section" of the man
-page - that number in parenthesis following the name, for example ls(1)
.
You could think of the man-pages as a set of actual manuals, divided into several volumes. For example, the 1st "volume" is section 1 which contains ordinary user commands - like ls(1), bash(1) and man(1). Section 8 contains commands for the system administrator - like commands for shutting down the system and install packages. (often commands that can't be used by non-root users.) Section 5 contains file-formats - like how /etc/passwd and /etc/sudo should be formatted. Section 3 contains library-functions for various languages (mostly for C) - like the C-function printf().
Note that some "commands" - like cd
and fg
- are really so-called built-ins in the shell, and don't have their own man-page. Instead they're documented in the man-pages for the particular shell - eg. in the man-page of bash(1). Shells may also provide alternatives to some commands as built-ins, and will usually use these instead of the external command. One example is how bash(1) got a built-in version of kill(1).
From the man-page of man-pages(7):
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)
9 Kernel routines [Non standard]
Sometimes letters or words are added to the number to denote the man-page belongs to a sub-system or package, for example, "x" for X GUI commands like startx(1x), or "tcl" for commands and functions belonging to the Tcl-language. Or even that they're "optional"/"additional" or "alternative" commands - for example, if you got two versions of tar
, one from GNU and one from BSD.
To get a specific section, you can add the section-number to your man-command:
man passwd
returns the passwd-command from section 1 (because section 1 is searched first, and the search then stops)
man 1 passwd
returns the same (but now because we specified section 1)
man 5 passwd
returns the file-format of /etc/passwd from section 5 (because we specified section 5 instead of 1)
To differentiate the two, you would refer to them as passwd(1) and passwd(5) (eg. if you wrote a textbook - or a man-page).
So the search-order makes sense - commands are more often sought than file-formats, not to mention programming libraries and system-calls.
Finally, you should note that different Unix-systems may use slightly different sectioning, for example, I've seen section 7 used for word-processing commands, and section 9 used for games, and I've seen section 9 used as a catch-all for various man-pages not fitting elsewhere.
It's the "section" of the man
-page - that number in parenthesis following the name, for example ls(1)
.
You could think of the man-pages as a set of actual manuals, divided into several volumes. For example, the 1st "volume" is section 1 which contains ordinary user commands - like ls(1), bash(1) and man(1). Section 8 contains commands for the system administrator - like commands for shutting down the system and install packages. (often commands that can't be used by non-root users.) Section 5 contains file-formats - like how /etc/passwd and /etc/sudo should be formatted. Section 3 contains library-functions for various languages (mostly for C) - like the C-function printf().
Note that some "commands" - like cd
and fg
- are really so-called built-ins in the shell, and don't have their own man-page. Instead they're documented in the man-pages for the particular shell - eg. in the man-page of bash(1). Shells may also provide alternatives to some commands as built-ins, and will usually use these instead of the external command. One example is how bash(1) got a built-in version of kill(1).
From the man-page of man-pages(7):
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)
9 Kernel routines [Non standard]
Sometimes letters or words are added to the number to denote the man-page belongs to a sub-system or package, for example, "x" for X GUI commands like startx(1x), or "tcl" for commands and functions belonging to the Tcl-language. Or even that they're "optional"/"additional" or "alternative" commands - for example, if you got two versions of tar
, one from GNU and one from BSD.
To get a specific section, you can add the section-number to your man-command:
man passwd
returns the passwd-command from section 1 (because section 1 is searched first, and the search then stops)
man 1 passwd
returns the same (but now because we specified section 1)
man 5 passwd
returns the file-format of /etc/passwd from section 5 (because we specified section 5 instead of 1)
To differentiate the two, you would refer to them as passwd(1) and passwd(5) (eg. if you wrote a textbook - or a man-page).
So the search-order makes sense - commands are more often sought than file-formats, not to mention programming libraries and system-calls.
Finally, you should note that different Unix-systems may use slightly different sectioning, for example, I've seen section 7 used for word-processing commands, and section 9 used for games, and I've seen section 9 used as a catch-all for various man-pages not fitting elsewhere.
edited yesterday
answered 2 days ago
Baard Kopperud
4,41342544
4,41342544
add a comment |
add a comment |
The man page of my Windows 10 Ubuntu man is even more confusing than the one posted above: "1 n l 8 3 2 3posix 3pm 3perl 3am 5 4 9 6 7"
– LongTP5
2 days ago
On a side note, you can set your own search order with
export MANSECT=0p:1:2:3:3p:4:5:6:7:8:9:l:s:n
– meuh
2 days ago