Command dmesg (short for display message) is a typical UNIX command used in order to print to stdout the “kernel buffer” messages. This cmd is useful for booting messages (when HW is initialized)…
If you haven’t “-T” option (dmesg -T show readable timestamps) you can use following 1-line :
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
Output:
...
2013-08-15 16:43:34 CEST -> [762273.568828] eth0: link down
2013-08-15 16:47:08 CEST -> [762487.411978] eth0: link up, full duplex, speed 1 Gbps
...
The post dmesg : how to make human readable timestamps appeared first on Busylog.net.