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

 

Linux commands in a nutshell

writing down a series of posts about GNU Linux commands.is one of the main purposes of this blog.
In these posts we are going to review some Linux commands with practical examples.This is not a complete but it’s a compact list of commands to refer when needed.These posts are not a linux training or a complete guide: you can use manpages for that (aka RTFM)The goal is share information about GNU Linux commands , improve my knowledge and use this website to cut & paste commands that I’m not able to remember 🙂

Bug fixes, suggestions and feedbacks are welcome as usual !

Posts list:

dmesg using human readable output format