1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
|
.\" $OpenBSD: man.conf.5,v 1.13 2010/10/28 21:18:03 jmc Exp $
.\"
.\" Copyright (c) 1989, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" @(#)man.conf.5 8.5 (Berkeley) 1/2/94
.\"
.Dd $Mdocdate: October 28 2010 $
.Dt MAN.CONF 5
.Os
.Sh NAME
.Nm man.conf
.Nd configuration file for
.Xr man 1
.Sh DESCRIPTION
The
.Xr man 1 ,
.Xr apropos 1 ,
and
.Xr whatis 1
commands
search for manual pages or their database files as specified by the
.Nm man.conf
file.
Manual pages are normally expected to be preformatted (see
.Xr mandoc 1 )
and named with a trailing
.Sq .0 .
.Pp
The
.Nm man.conf
file contains two types of lines.
.Pp
The first type of line is a
.Dq section
line, which contains a section name followed by one or more directory paths.
The directory paths may contain the normal shell globbing characters,
including curly braces
.Pq Sq {} ;
to escape a shell globbing character, precede it with a backslash
.Pq Sq \e .
Lines in this format specify that manual pages for the section
may be found in the following directories.
.Pp
Directories named with a trailing slash character
.Pq Sq /
are expected to contain subdirectories of manual pages, (see the keyword
.Dq _subdir
below) instead of manual pages.
These subdirectories are searched instead of the directory.
.Pp
Before searching any directory for a manual page, the
.Xr man 1
command always searches the subdirectory with the same name
as the current machine type, if it exists.
No specification of these subdirectories is necessary in the
.Nm man.conf
file.
.Pp
Section names are unrestricted except for the reserved words specified
below; in general, you should avoid anything with a leading underscore
.Pq Sq _
to avoid future incompatibilities.
.Pp
The section named
.Dq _default
is the list of directories that will
be searched if no section is specified by the user.
.Pp
The second type of line is preceded with a
.Dq keyword .
The possible keywords and their meanings are as follows:
.Bl -tag -width "_version"
.It _build
Man file names, regardless of their format, are expected to end in a
.Sq .*
pattern, i.e. a
.Sq .\&
followed by some suffix.
The first field of a _build line lists a suffix which indicates
files which need to be reformatted or manipulated in some way before
being displayed to the user.
The suffix may contain the normal shell globbing characters (NOT
including curly braces
.Pq Sq {} ) .
The rest of the line must be a shell command line, the standard
output of which is the manual page in a format which may be directly
displayed to the user.
Any occurrences of the string
.Sq %s
in the shell command line will
be replaced by the name of the file which is being reformatted.
.It _subdir
The list
.Pq in search order
of subdirectories which will be searched in
any directory named with a trailing slash
.Pq Sq /
character.
This list is also used when a path is specified to the
.Xr man 1
utility by the user, using the
.Ev MANPATH
environment variable or the
.Fl M
and
.Fl m
options.
.It _suffix
Man file names, regardless of their format, are expected to end in a
.Sq .*
pattern, i.e. a
.Sq .\&
followed by some suffix.
Each field of a _suffix line is a suffix which indicates
files which do not need to be reformatted or manipulated
in any way, but which may be directly displayed to the user.
Each suffix may contain the normal shell globbing characters (NOT
including curly braces
.Pq Sq {} ) .
.It _version
The version of the configuration file.
.It _whatdb
The full pathname
.Pq not just a directory path
for a database to be used by the
.Xr apropos 1
and
.Xr whatis 1
commands.
.El
.Pp
Multiple specifications for all types of lines are cumulative and the
entries are used in the order listed in the file; multiple entries may
be listed per line, as well.
.Pp
Empty lines or lines whose first non-whitespace character is a hash mark
.Pq Sq #
are ignored.
.Sh FILES
.Bl -tag -width /etc/man.conf -compact
.It Pa /etc/man.conf
standard manual directory search path
.El
.Sh EXAMPLES
Given the following
.Nm man.conf
file:
.Bd -literal -offset indent
_version BSD.2
_subdir cat1 cat3 cat2
_suffix .0
_build .[1-9] /usr/bin/mandoc %s
_build .tbl /usr/bin/mandoc %s
_default /usr/share/man/
sect3 /usr/share/man/{old/,}cat3
.Ed
.Pp
By default, the command
.Dq Li man mktemp
will search for
.Dq mktemp.\*(Ltany_digit\*(Gt
and
.Dq mktemp.tbl
in the directories
.Pa /usr/share/man/cat1 ,
.Pa /usr/share/man/cat3 ,
and
.Pa /usr/share/man/cat2 ,
in that order.
If on a machine of type
.Dq vax ,
the subdirectory
.Dq vax
in each directory would be searched as well,
before the rest of the directory was searched.
.Pp
If
.Dq mktemp.tbl
was found first, the command
.Dq /usr/bin/mandoc mktemp.tbl
would be run to build a man page for display to the user.
.Pp
The command
.Dq Li man sect3 mktemp
would search the directories
.Pa /usr/share/man/old/cat3
and
.Pa /usr/share/man/cat3 ,
in that order, for the mktemp manual page.
If a subdirectory with the same name as the current machine type
existed in any of them, it would be searched as well, before each
of them were searched.
.Sh SEE ALSO
.Xr apropos 1 ,
.Xr machine 1 ,
.Xr man 1 ,
.Xr whatis 1 ,
.Xr whereis 1 ,
.Xr fnmatch 3 ,
.Xr glob 3
|