Comparing Kernel Dmesgs: Remove Timing Info and Diff Side by Side

I often wanted to compare what new messages appear or disappear in a new kernel so check out what might have changed, esp. when debugging. The problem is that diff is confused by the timing information that is by default prepended to dmesg information in Ubuntu kernels.

Here's how to remove the timing information to have a clean, diff-compatible dmesg log:
sed 's/^...............//'
The command basically removes the first (number of dots ".") characters of every line.

Then you can use diff to compare the dmesg files side by side:
diff -y -w -B --suppress-common-lines dmesg-A dmesg-B
Of course this is still not magic, but at least now diff can filter out a lot of similarities for you.


I appreciate comments. Feel free to write anything you wish. Selected comments and questions will be published.