Linux中查看一个目录的大小脚本

#!/bin/bash

FILE=/usr/local/mysql

FILESIZE=`du  -s   $FILE| awk '{print $1}'`|cut -f 1 -d 'M'

if [ $FILESIZE  -gt   20 ]; then

 echo "the file size is  more  than  the primary file"

else

 echo "the file size is less than the primary file"

fi


你可能感兴趣的:(linux,File,local,primary)