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