#!/bin/bash
end=`dmesg |wc -l`
while true
do
sleep 1
end2=`dmesg |wc -l`
if [ "$end" != "$end2" ]; then
dmesg |awk '{print NR, $0}'|tail -$((end2-end))
end=$end2
fi
if [ "$end" -ge 1000 ]
then
dmesg -c >/dev/null 2>&1
echo "**********************"
echo "*dmesg -c now; *"
echo "**********************"
end=`dmesg |wc -l`
fi
done
内核dmes日志实时打印脚本
猜你喜欢
转载自blog.csdn.net/sun172270102/article/details/103201915
今日推荐
周排行