dmesg 时间戳转换_如何在Linux上将dmesg时间戳转换为更易于阅读的格式?

dmesg 时间戳转换

The dmesg results from newer Linux kernels show the timestamps. It seems the time in seconds since the kernel start time.

较新的Linux内核的dmesg结果显示了时间戳。 从内核启动时间开始 ,似乎是秒数。

How to convert the dmesg timestamps to the real time on Linux?

如何在Linux上将dmesg时间戳转换为实时?

The dmesg timestamp is the time in seconds since the kernel starting time.

dmesg时间戳是自内核启动时间以来的时间(以秒为单位)。

Later dmesg has an -T option:

以后的dmesg具有-T选项

-T, –ctime
Print human-readable timestamps.
Be aware that the timestamp could be inaccurate! The time source used for the logs is not updated after system SUSPEND/RESUME.

-T,–ctime
打印人类可读的时间戳。
请注意,时间戳记可能不正确! 挂起/恢复系统后,用于日志的时间源不会更新。

So

所以

dmesg -T

will print the real time stamps like

将打印像

[Mon Oct  3 18:43:21 2016] SELinux: initialized (dev tmpfs, type tmpfs), uses transition SIDs
[Mon Oct  3 18:53:22 2016] SELinux: initialized (dev tmpfs, type tmpfs), uses transition SIDs
[Mon Oct  3 19:03:22 2016] SELinux: initialized (dev tmpfs, type tmpfs), uses transition SIDs
[Mon Oct  3 19:13:23 2016] SELinux: initialized (dev tmpfs, type tmpfs), uses transition SIDs
Answered by Eric Z Ma.
埃里克·马(Eric Z Ma)回答。

翻译自: https://www.systutorials.com/how-to-convert-the-dmesg-timestamps-to-easier-to-read-format-on-linux/

dmesg 时间戳转换

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值