OSDN Git Service

util-linux 2.38: 翻訳予約。
[linuxjm/jm.git] / manual / util-linux / original / man1 / dmesg.1
1 '\" t
2 .\"     Title: dmesg
3 .\"    Author: [see the "AUTHOR(S)" section]
4 .\" Generator: Asciidoctor 2.0.15
5 .\"      Date: 2022-02-17
6 .\"    Manual: User Commands
7 .\"    Source: util-linux 2.38
8 .\"  Language: English
9 .\"
10 .TH "DMESG" "1" "2022-02-17" "util\-linux 2.38" "User Commands"
11 .ie \n(.g .ds Aq \(aq
12 .el       .ds Aq '
13 .ss \n[.ss] 0
14 .nh
15 .ad l
16 .de URL
17 \fI\\$2\fP <\\$1>\\$3
18 ..
19 .als MTO URL
20 .if \n[.g] \{\
21 .  mso www.tmac
22 .  am URL
23 .    ad l
24 .  .
25 .  am MTO
26 .    ad l
27 .  .
28 .  LINKSTYLE blue R < >
29 .\}
30 .SH "NAME"
31 dmesg \- print or control the kernel ring buffer
32 .SH "SYNOPSIS"
33 .sp
34 \fBdmesg\fP [options]
35 .sp
36 \fBdmesg\fP \fB\-\-clear\fP
37 .sp
38 \fBdmesg\fP \fB\-\-read\-clear\fP [options]
39 .sp
40 \fBdmesg\fP \fB\-\-console\-level\fP \fIlevel\fP
41 .sp
42 \fBdmesg\fP \fB\-\-console\-on\fP
43 .sp
44 \fBdmesg\fP \fB\-\-console\-off\fP
45 .SH "DESCRIPTION"
46 .sp
47 \fBdmesg\fP is used to examine or control the kernel ring buffer.
48 .sp
49 The default action is to display all messages from the kernel ring buffer.
50 .SH "OPTIONS"
51 .sp
52 The \fB\-\-clear\fP, \fB\-\-read\-clear\fP, \fB\-\-console\-on\fP, \fB\-\-console\-off\fP, and \fB\-\-console\-level\fP options are mutually exclusive.
53 .sp
54 \fB\-C\fP, \fB\-\-clear\fP
55 .RS 4
56 Clear the ring buffer.
57 .RE
58 .sp
59 \fB\-c\fP, \fB\-\-read\-clear\fP
60 .RS 4
61 Clear the ring buffer after first printing its contents.
62 .RE
63 .sp
64 \fB\-D\fP, \fB\-\-console\-off\fP
65 .RS 4
66 Disable the printing of messages to the console.
67 .RE
68 .sp
69 \fB\-d\fP, \fB\-\-show\-delta\fP
70 .RS 4
71 Display the timestamp and the time delta spent between messages. If used together with \fB\-\-notime\fP then only the time delta without the timestamp is printed.
72 .RE
73 .sp
74 \fB\-E\fP, \fB\-\-console\-on\fP
75 .RS 4
76 Enable printing messages to the console.
77 .RE
78 .sp
79 \fB\-e\fP, \fB\-\-reltime\fP
80 .RS 4
81 Display the local time and the delta in human\-readable format. Be aware that conversion to the local time could be inaccurate (see \fB\-T\fP for more details).
82 .RE
83 .sp
84 \fB\-F\fP, \fB\-\-file\fP \fIfile\fP
85 .RS 4
86 Read the syslog messages from the given \fIfile\fP. Note that \fB\-F\fP does not support messages in kmsg format. The old syslog format is supported only.
87 .RE
88 .sp
89 \fB\-f\fP, \fB\-\-facility\fP \fIlist\fP
90 .RS 4
91 Restrict output to the given (comma\-separated) \fIlist\fP of facilities. For example:
92 .sp
93 \fBdmesg \-\-facility=daemon\fP
94 .sp
95 will print messages from system daemons only. For all supported facilities see the \fB\-\-help\fP output.
96 .RE
97 .sp
98 \fB\-H\fP, \fB\-\-human\fP
99 .RS 4
100 Enable human\-readable output. See also \fB\-\-color\fP, \fB\-\-reltime\fP and \fB\-\-nopager\fP.
101 .RE
102 .sp
103 \fB\-J\fP, \fB\-\-json\fP
104 .RS 4
105 Use JSON output format. The time output format is in "sec.usec" format only, log priority level is not decoded by default (use \fB\-\-decode\fP to split into facility and priority), the other options to control the output format or time format are silently ignored.
106 .RE
107 .sp
108 \fB\-k\fP, \fB\-\-kernel\fP
109 .RS 4
110 Print kernel messages.
111 .RE
112 .sp
113 \fB\-L\fP, \fB\-\-color\fP[=\fIwhen\fP]
114 .RS 4
115 Colorize the output. The optional argument \fIwhen\fP can be \fBauto\fP, \fBnever\fP or \fBalways\fP. If the \fIwhen\fP argument is omitted, it defaults to \fBauto\fP. The colors can be disabled; for the current built\-in default see the \fB\-\-help\fP output. See also the \fBCOLORS\fP section below.
116 .RE
117 .sp
118 \fB\-l\fP, \fB\-\-level\fP \fIlist\fP
119 .RS 4
120 Restrict output to the given (comma\-separated) \fIlist\fP of levels. For example:
121 .sp
122 \fBdmesg \-\-level=err,warn\fP
123 .sp
124 will print error and warning messages only. For all supported levels see the \fB\-\-help\fP output.
125 .RE
126 .sp
127 \fB\-n\fP, \fB\-\-console\-level\fP \fIlevel\fP
128 .RS 4
129 Set the \fIlevel\fP at which printing of messages is done to the console. The \fIlevel\fP is a level number or abbreviation of the level name. For all supported levels see the \fB\-\-help\fP output.
130 .sp
131 For example, \fB\-n 1\fP or \fB\-n emerg\fP prevents all messages, except emergency (panic) messages, from appearing on the console. All levels of messages are still written to \fI/proc/kmsg\fP, so \fBsyslogd\fP(8) can still be used to control exactly where kernel messages appear. When the \fB\-n\fP option is used, \fBdmesg\fP will \fInot\fP print or clear the kernel ring buffer.
132 .RE
133 .sp
134 \fB\-\-noescape\fP
135 .RS 4
136 The unprintable and potentially unsafe characters (e.g., broken multi\-byte sequences, terminal controlling chars, etc.) are escaped in format \(rsx<hex> for security reason by default. This option disables this feature at all. It\(cqs usable for example for debugging purpose together with \fB\-\-raw\fP. Be careful and don\(cqt use it by default.
137 .RE
138 .sp
139 \fB\-P\fP, \fB\-\-nopager\fP
140 .RS 4
141 Do not pipe output into a pager. A pager is enabled by default for \fB\-\-human\fP output.
142 .RE
143 .sp
144 \fB\-p\fP, \fB\-\-force\-prefix\fP
145 .RS 4
146 Add facility, level or timestamp information to each line of a multi\-line message.
147 .RE
148 .sp
149 \fB\-r\fP, \fB\-\-raw\fP
150 .RS 4
151 Print the raw message buffer, i.e., do not strip the log\-level prefixes, but all unprintable characters are still escaped (see also \fB\-\-noescape\fP).
152 .sp
153 Note that the real raw format depends on the method how \fBdmesg\fP reads kernel messages. The \fI/dev/kmsg\fP device uses a different format than \fBsyslog\fP(2). For backward compatibility, \fBdmesg\fP returns data always in the \fBsyslog\fP(2) format. It is possible to read the real raw data from \fI/dev/kmsg\fP by, for example, the command \(aqdd if=/dev/kmsg iflag=nonblock\(aq.
154 .RE
155 .sp
156 \fB\-S\fP, \fB\-\-syslog\fP
157 .RS 4
158 Force \fBdmesg\fP to use the \fBsyslog\fP(2) kernel interface to read kernel messages. The default is to use \fI/dev/kmsg\fP rather than \fBsyslog\fP(2) since kernel 3.5.0.
159 .RE
160 .sp
161 \fB\-s\fP, \fB\-\-buffer\-size\fP \fIsize\fP
162 .RS 4
163 Use a buffer of \fIsize\fP to query the kernel ring buffer. This is 16392 by default. (The default kernel syslog buffer size was 4096 at first, 8192 since 1.3.54, 16384 since 2.1.113.) If you have set the kernel buffer to be larger than the default, then this option can be used to view the entire buffer.
164 .RE
165 .sp
166 \fB\-T\fP, \fB\-\-ctime\fP
167 .RS 4
168 Print human\-readable timestamps.
169 .sp
170 \fBBe aware that the timestamp could be inaccurate!\fP The \fBtime\fP source used for the logs is \fBnot updated after\fP system \fBSUSPEND\fP/\fBRESUME\fP. Timestamps are adjusted according to current delta between boottime and monotonic clocks, this works only for messages printed after last resume.
171 .RE
172 .sp
173 \fB\-\-since\fP \fItime\fP
174 .RS 4
175 Display record since the specified time. The time is possible to specify in absolute way as well as by relative notation (e.g. \(aq1 hour ago\(aq). Be aware that the timestamp could be inaccurate and see \fB\-\-ctime\fP for more details.
176 .RE
177 .sp
178 \fB\-\-until\fP \fItime\fP
179 .RS 4
180 Display record until the specified time. The time is possible to specify in absolute way as well as by relative notation (e.g. \(aq1 hour ago\(aq). Be aware that the timestamp could be inaccurate and see \fB\-\-ctime\fP for more details.
181 .RE
182 .sp
183 \fB\-t\fP, \fB\-\-notime\fP
184 .RS 4
185 Do not print kernel\(cqs timestamps.
186 .RE
187 .sp
188 \fB\-\-time\-format\fP \fIformat\fP
189 .RS 4
190 Print timestamps using the given \fIformat\fP, which can be \fBctime\fP, \fBreltime\fP, \fBdelta\fP or \fBiso\fP. The first three formats are aliases of the time\-format\-specific options. The \fBiso\fP format is a \fBdmesg\fP implementation of the ISO\-8601 timestamp format. The purpose of this format is to make the comparing of timestamps between two systems, and any other parsing, easy. The definition of the \fBiso\fP timestamp is: YYYY\-MM\-DD<T>HH:MM:SS,<microseconds>\(<-+><timezone offset from UTC>.
191 .sp
192 The \fBiso\fP format has the same issue as \fBctime\fP: the time may be inaccurate when a system is suspended and resumed.
193 .RE
194 .sp
195 \fB\-u\fP, \fB\-\-userspace\fP
196 .RS 4
197 Print userspace messages.
198 .RE
199 .sp
200 \fB\-w\fP, \fB\-\-follow\fP
201 .RS 4
202 Wait for new messages. This feature is supported only on systems with a readable \fI/dev/kmsg\fP (since kernel 3.5.0).
203 .RE
204 .sp
205 \fB\-W\fP, \fB\-\-follow\-new\fP
206 .RS 4
207 Wait and print only new messages.
208 .RE
209 .sp
210 \fB\-x\fP, \fB\-\-decode\fP
211 .RS 4
212 Decode facility and level (priority) numbers to human\-readable prefixes.
213 .RE
214 .sp
215 \fB\-h\fP, \fB\-\-help\fP
216 .RS 4
217 Display help text and exit.
218 .RE
219 .sp
220 \fB\-V\fP, \fB\-\-version\fP
221 .RS 4
222 Print version and exit.
223 .RE
224 .SH "COLORS"
225 .sp
226 The output colorization is implemented by \fBterminal\-colors.d\fP(5) functionality.
227 Implicit coloring can be disabled by an empty file
228 .RS 3
229 .ll -.6i
230 .sp
231 \fI/etc/terminal\-colors.d/dmesg.disable\fP
232 .br
233 .RE
234 .ll
235 .sp
236 for the \fBdmesg\fP command or for all tools by
237 .RS 3
238 .ll -.6i
239 .sp
240 \fI/etc/terminal\-colors.d/disable\fP
241 .br
242 .RE
243 .ll
244 .sp
245 The user\-specific \fI$XDG_CONFIG_HOME/terminal\-colors.d\fP
246 or \fI$HOME/.config/terminal\-colors.d\fP overrides the global setting.
247 .sp
248 Note that the output colorization may be enabled by default, and in this case
249 \fIterminal\-colors.d\fP directories do not have to exist yet.
250 .sp
251 The logical color names supported by \fBdmesg\fP are:
252 .sp
253 \fBsubsys\fP
254 .RS 4
255 The message sub\-system prefix (e.g., "ACPI:").
256 .RE
257 .sp
258 \fBtime\fP
259 .RS 4
260 The message timestamp.
261 .RE
262 .sp
263 \fBtimebreak\fP
264 .RS 4
265 The message timestamp in short ctime format in \fB\-\-reltime\fP or \fB\-\-human\fP output.
266 .RE
267 .sp
268 \fBalert\fP
269 .RS 4
270 The text of the message with the alert log priority.
271 .RE
272 .sp
273 \fBcrit\fP
274 .RS 4
275 The text of the message with the critical log priority.
276 .RE
277 .sp
278 \fBerr\fP
279 .RS 4
280 The text of the message with the error log priority.
281 .RE
282 .sp
283 \fBwarn\fP
284 .RS 4
285 The text of the message with the warning log priority.
286 .RE
287 .sp
288 \fBsegfault\fP
289 .RS 4
290 The text of the message that inform about segmentation fault.
291 .RE
292 .SH "EXIT STATUS"
293 .sp
294 \fBdmesg\fP can fail reporting permission denied error. This is usually caused by \fBdmesg_restrict\fP kernel setting, please see \fBsyslog\fP(2) for more details.
295 .SH "AUTHORS"
296 .sp
297 .MTO "kzak\(atredhat.com" "Karel Zak" ""
298 .sp
299 \fBdmesg\fP was originally written by \c
300 .MTO "tytso\(atathena.mit.edu" "Theodore Ts\(cqo" "."
301 .SH "SEE ALSO"
302 .sp
303 \fBterminal\-colors.d\fP(5),
304 \fBsyslogd\fP(8)
305 .SH "REPORTING BUGS"
306 .sp
307 For bug reports, use the issue tracker at \c
308 .URL "https://github.com/util\-linux/util\-linux/issues" "" "."
309 .SH "AVAILABILITY"
310 .sp
311 The \fBdmesg\fP command is part of the util\-linux package which can be downloaded from \c
312 .URL "https://www.kernel.org/pub/linux/utils/util\-linux/" "Linux Kernel Archive" "."