This week only. Pastebin PRO Accounts Christmas Special! Don't miss 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: 301  |  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
  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
clone this paste RAW Paste Data