1MAN(1) BSD General Commands Manual MAN(1)
2
4 man — display manual pages
5
7 man [-acfhklw] [-C file] [-M path] [-m path] [-S subsection]
8 [[-s] section] name ...
9
11 The man utility displays the manual page entitled name. Pages may be se‐
12 lected according to a specific category (section) or machine architecture
13 (subsection).
14
15 The options are as follows:
16
17 -a Display all matching manual pages.
18
19 -C file
20 Use the specified file instead of the default configuration file.
21 This permits users to configure their own manual environment.
22 See man.conf(5) for a description of the contents of this file.
23
24 -c Copy the manual page to the standard output instead of using
25 less(1) to paginate it. This is done by default if the standard
26 output is not a terminal device.
27
28 When using -c, most terminal devices are unable to show the
29 markup. To print the output of man to the terminal with markup
30 but without using a pager, pipe it to ul(1). To remove the
31 markup, pipe the output to col(1) -b instead.
32
33 -f A synonym for whatis(1). It searches for name in manual page
34 names and displays the header lines from all matching pages. The
35 search is case insensitive and matches whole words only.
36
37 -h Display only the SYNOPSIS lines of the requested manual pages.
38 Implies -a and -c.
39
40 -k A synonym for apropos(1). Instead of name, an expression can be
41 provided using the syntax described in the apropos(1) manual. By
42 default, it displays the header lines of all matching pages.
43
44 -l A synonym for mandoc(1). The name arguments are interpreted as
45 filenames. No search is done and file, path, section,
46 subsection, and -w are ignored. This option implies -a.
47
48 -M path
49 Override the list of directories to search for manual pages. The
50 supplied path must be a colon (‘:’) separated list of directo‐
51 ries. This option also overrides the environment variable
52 MANPATH and any directories specified in the man.conf(5) file.
53
54 -m path
55 Augment the list of directories to search for manual pages. The
56 supplied path must be a colon (‘:’) separated list of directo‐
57 ries. These directories will be searched before those specified
58 using the -M option, the MANPATH environment variable, the
59 man.conf(5) file, or the default directories.
60
61 -S subsection
62 Only show pages for the specified machine(1) architecture.
63 subsection is case insensitive.
64
65 By default manual pages for all architectures are installed.
66 Therefore this option can be used to view pages for one architec‐
67 ture whilst using another.
68
69 This option overrides the MACHINE environment variable.
70
71 [-s] section
72 Only select manuals from the specified section. The currently
73 available sections are:
74
75 1 General commands (tools and utilities).
76 2 System calls and error numbers.
77 3 Library functions.
78 3p perl(1) programmer's reference guide.
79 4 Device drivers.
80 5 File formats.
81 6 Games.
82 7 Miscellaneous information.
83 8 System maintenance and operation commands.
84 9 Kernel internals.
85
86 -w List the pathnames of all matching manual pages instead of dis‐
87 playing any of them. If no name is given, list the directories
88 that would be searched.
89
90 The options -IKOTW are also supported and are documented in mandoc(1).
91 The options -fkl are mutually exclusive and override each other.
92
93 The search starts with the -m argument if provided, then continues with
94 the -M argument, the MANPATH variable, the manpath entries in the
95 man.conf(5) file, or with /usr/share/man:/usr/X11R6/man:/usr/local/man by
96 default. Within each of these, directories are searched in the order
97 provided. Within each directory, the search proceeds according to the
98 following list of sections: 1, 8, 6, 2, 3, 5, 7, 4, 9, 3p. The first
99 match found is shown.
100
101 The mandoc.db(5) database is used for looking up manual page entries. In
102 cases where the database is absent, outdated, or corrupt, man falls back
103 to looking for files called name.section. If both a formatted and an un‐
104 formatted version of the same manual page, for example cat1/foo.0 and
105 man1/foo.1, exist in the same directory, only the unformatted version is
106 used. The database is kept up to date with makewhatis(8), which is run
107 by the weekly(8) maintenance script.
108
109 Guidelines for writing man pages can be found in mdoc(7).
110
112 MACHINE As some manual pages are intended only for specific architec‐
113 tures, man searches any subdirectories, with the same name as
114 the current architecture, in every directory which it searches.
115 Machine specific areas are checked before general areas. The
116 current machine type may be overridden by setting the environ‐
117 ment variable MACHINE to the name of a specific architecture,
118 or with the -S option. MACHINE is case insensitive.
119
120 MANPAGER Any non-empty value of the environment variable MANPAGER is
121 used instead of the standard pagination program, less(1). If
122 less(1) is used, the interactive :t command can be used to go
123 to the definitions of various terms, for example command line
124 options, command modifiers, internal commands, environment
125 variables, function names, preprocessor macros, errno(2) val‐
126 ues, and some other emphasized words. Some terms may have
127 defining text at more than one place. In that case, the
128 less(1) interactive commands t and T can be used to move to the
129 next and to the previous place providing information about the
130 term last searched for with :t. The -O tag[=term] option docu‐
131 mented in the mandoc(1) manual opens a manual page at the defi‐
132 nition of a specific term rather than at the beginning.
133
134 MANPATH Override the standard search path which is either specified in
135 man.conf(5) or the default path. The format of MANPATH is a
136 colon (‘:’) separated list of directories. Invalid directories
137 are ignored. Overridden by -M, ignored if -l is specified.
138
139 If MANPATH begins with a colon, it is appended to the standard
140 path; if it ends with a colon, it is prepended to the standard
141 path; or if it contains two adjacent colons, the standard path
142 is inserted between the colons.
143
144 PAGER Specifies the pagination program to use when MANPAGER is not
145 defined. If neither PAGER nor MANPAGER is defined, less(1) is
146 used.
147
149 /etc/man.conf default man configuration file
150
152 The man utility exits 0 on success, and >0 if an error occurs. See
153 mandoc(1) for details.
154
156 Format a page for pasting extracts into an email message — avoid printing
157 any UTF-8 characters, reduce the width to ease quoting in replies, and
158 remove markup:
159
160 $ man -T ascii -O width=65 pledge | col -b
161
162 Read a typeset page in a PDF viewer:
163
164 $ MANPAGER=mupdf man -T pdf lpd
165
167 apropos(1), col(1), mandoc(1), ul(1), whereis(1), man.conf(5), mdoc(7)
168
170 The man utility is compliant with the IEEE Std 1003.1-2008 (“POSIX.1”)
171 specification.
172
173 The flags [-aCcfhIKlMmOSsTWw], as well as the environment variables
174 MACHINE, MANPAGER, and MANPATH, are extensions to that specification.
175
177 A man command first appeared in Version 2 AT&T UNIX.
178
179 The -w option first appeared in Version 7 AT&T UNIX; -f and -k in 4BSD;
180 -M in 4.3BSD; -a in 4.3BSD-Tahoe; -c and -m in 4.3BSD-Reno; -h in 4.3BSD
181 Net/2; -C in NetBSD 1.0; -s and -S in OpenBSD 2.3; and -I, -K, -l, -O,
182 and -W in OpenBSD 5.7. The -T option first appeared in AT&T System III
183 UNIX and was also added in OpenBSD 5.7.
184
185BSD July 20, 2020 BSD