Compare Dmesg Output between boots

First remove the timing information from the dmesg with a sed Regular expression:

cat dmesg.txt| sed -r s/'\[[ ]*[0-9]+[.][0-9]+\]'//g > dmesg-clean.txt

Of course you can skip this step if you care about the timing information.

Then compare two kernel boot dmesgs.

diff -y --left-column dmesg1.txt dmesg2.txt | less

And as a script:

# published under GPL v. 3.0
# (c) 2008

cat "$1" | sed -r s/'\[[ ]*[0-9]+[.][0-9]+\]'//g > DMESGCOMPARE-${1}.txt
cat "$2" | sed -r s/'\[[ ]*[0-9]+[.][0-9]+\]'//g > DMESGCOMPARE-${2}.txt

diff -y --left-column DMESGCOMPARE-${1}.txt DMESGCOMPARE-${2}.txt | less


No comments:

Post a Comment

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