linux dmesg 显示可读时间格式

客官°小女子只卖身不卖艺 2021-09-01 09:56 825阅读 0赞

dmesg -T

直接用dmesg显示系统信息,很难看

[95721.670025] snapshot device recevied [read] io request, access on dev sector[272], length is [240] sectors.
[95721.670363] device is closed
[95721.693207] device is closed
显示的时间没有办法看。

使用dmesg —help看到,如下:

Usage:
dmesg [options]

Display or control the kernel ring buffer.

Options:
-C, —clear clear the kernel ring buffer
-c, —read-clear read and clear all messages
-D, —console-off disable printing messages to console
-E, —console-on enable printing messages to console
-F, —file use the file instead of the kernel log buffer
-f, —facility restrict output to defined facilities
-H, —human human readable output
-k, —kernel display kernel messages
-L, —color[=] colorize messages (auto, always or never)
colors are enabled by default
-l, —level restrict output to defined levels
-n, —console-level set level of messages printed to console
-P, —nopager do not pipe output into a pager
-r, —raw print the raw message buffer
-S, —syslog force to use syslog(2) rather than /dev/kmsg
-s, —buffer-size buffer size to query the kernel ring buffer
-u, —userspace display userspace messages
-w, —follow wait for new messages
-x, —decode decode facility and level to readable string
-d, —show-delta show time delta between printed messages
-e, —reltime show local time and time delta in readable format
-T, —ctime show human readable timestamp (may be inaccurate!)
-t, —notime don’t print messages timestamp
—time-format show time stamp using format:
[delta|reltime|ctime|notime|iso]
Suspending/resume will make ctime and iso timestamps inaccurate.

-h, —help display this help and exit

可以使用-T来显示可读时间,如下:

dmesg -T

[Fri Aug 31 17:55:32 2018] device is closed
[Fri Aug 31 17:55:32 2018] device is closed

发表评论

表情:
评论列表 (有 0 条评论,825人围观)

还没有评论,来说两句吧...

相关阅读

    相关 Linux dmesg 命令学习

    /proc文件系统     在 /proc 文件系统中,对虚拟文件的读写操作是一种与内核通信的手段,要查看内核回环缓冲区中的消息,可以使用 dmesg 工具(或者通过 /p

    相关 Linux dmesg命令

    Linux dmesg命令用于显示开机信息。 kernel会将开机信息存储在ring buffer中。您若是开机时来不及查看信息,可利用dmesg来查看。开机信息亦保存在...