磁盘检查shell

#!/bin/bash
#磁盘空间测试
IP=` ifconfig eth0 | grep 'inet addr' | sed 's/Bcast.*//'| awk -F : '{print $2}'`
SPACE=`df | awk '{print $5}'| sed -n '2,6p' | sed 's/%//'`
for i in $SPACE
do
if [ $i -gt 80 ]
then
   echo "The addr $IP have space is more than 80%"
fi
done
~

你可能感兴趣的:(shell,小脚本)