Getting an idea of when each /var/log/messages file, compressed or not, first started. Printing the first line of each file.
for logfile in /var/log/messages*
do
if [[ $logfile == *.bz2 ]]
then
echo -ne "$logfile\t"
bzcat $logfile | head -1
else
echo -ne "$logfile\t"
cat $logfile | head -1
fi
done
No comments:
Post a Comment