Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!

Dmesg with full date

By: gaspar_fm on Mar 11th, 2013  |  syntax: Bash  |  size: 0.27 KB  |  views: 273  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # dmesg with full date
  2.  
  3. 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