25 Responses to “Come rendere gli orari di dmesg leggibili”

Older versions of dmesg do not have this option. To upgrade dmesg, you need to upgrade the “util-linux” package (Debian based distros). After updating your apt cache, run “sudo apt-get install util-linux”. Dmesg options become:

this should work at least.
Perhaps someone can drop the wrong quouted ones.

Explanation for perl-dummies

# use program code from argument line and make an implicit loop to read in stdin.
perl -ne ‘
# the BEGIN block is executed only once and directly after perl startup.
BEGIN{
# calculate the timestamp of systems startup
$a= time()- qx{cat /proc/uptime}
};
# now for every line
# substitute the integer part of dmsg timestamp with a human readable value
s/\[(\d+)\.\d+\]/localtime($1 + $a)/e;
# and print it out
print;
‘