1 Star 0 Fork 0

houmingzhang/mycommand

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
dmesgtime.sh 402 Bytes
一键复制 编辑 原始数据 按行查看 历史
houmingzhang 提交于 2020-10-01 11:10 +08:00 . 命令
#!/bin/bash
dmesg_with_human_timestamps () {
$(type -P dmesg) "$@" | perl -w -e 'use strict;
my ($uptime) = do { local @ARGV="/proc/uptime";<>}; ($uptime) = ($uptime =~ /^(\d+)\./);
foreach my $line (<>) {
printf( ($line=~/^\[\s*(\d+)\.\d+\](.+)/) ? ( "[%s]%s\n", scalar localtime(time - $uptime + $1), $2 ) : $line )
}'
}
alias dmesg=dmesg_with_human_timestamps
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/dtrylzhm/mycommand.git
git@gitee.com:dtrylzhm/mycommand.git
dtrylzhm
mycommand
mycommand
master

搜索帮助