Compare Dmesg Output between boots

Diposkan oleh Unknown on Monday, June 16, 2008

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:

#!/bin/bash
# published under GPL v. 3.0
# (c) 2008 linux-tipps.blogspot.com

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

rm DMESGCOMPARE-${1}.txt DMESGCOMPARE-${2}.txt

{ 0 komentar... read them below or add one }

Post a Comment

Come on share your comment, but please do not spam