Linux 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看到,如下:

 dmesg [options]

Display or control the kernel ring buffer.

 -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 <file>           use the file instead of the kernel log buffer
 -f, --facility <list>       restrict output to defined facilities
 -H, --human                 human readable output
 -k, --kernel                display kernel messages
 -L, --color[=<when>]        colorize messages (auto, always or never)
                               colors are enabled by default
 -l, --level <list>          restrict output to defined levels
 -n, --console-level <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 <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 <format>  show time stamp using format:
Suspending/resume will make ctime and iso timestamps inaccurate.

 -h, --help     display this help and exit


dmesg -T

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

发布了77 篇原创文章 · 获赞 5 · 访问量 11万+


©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客