dmesg using human readable output format

dmesg – print or control the kernel ring buffer

dmesg output drives me crazy due to the timestamp. A lot of times I said: “there must be a way to human readable date !!!”  and now it is:

# dmesg -T

No vars and conversions, just a simple option !!

Unfortunately this option doesn’t work on old dmesg releases. On Ubuntu 12.10 (utili-linux v2.20), it works, no way for Red Hat 6 .

Fedora 19 (util-linux 2.23) can do better using color output and pager by the following option:

# dmesg -H

If  -T and -H option are not available, you can use the follow script:

# dmesg | awk -F ] '{"cat /proc/uptime | cut -d \" \" -f 1" | getline st;a=substr( $1,2, length($1) - 1);print strftime("%F %H:%M:%S %Z",systime()-st+a)" -> "$0}' | more