# dmesg with full date base=$(cat /proc/uptime | cut -d ‘.’ -f1); seconds=`date +%s`; dmesg | sed 's/^\[\(.*\)\..*\]\(.*\)$/\1\n\2/' | while read first; do read second; first=`date +"%d/%m/%Y %H:%M:%S" --date="@$(($seconds - $base + $first))"`; echo "[$first] $second"; done