1
2
3
4
5
6
7
8
9
10
11
12
| for file in $@
do
if [ -f "$file" –o –d "$file" ]
then
if [ -f "$file" ] && [ `ls –l $file|awk '{print $5}'` -gt 2147483648 ]
then
echo "$file size is larger than 2G,will be deleted directly"
`rm –rf $file`
elif [ -d "$file" ] && [ `du –sb $file|awk '{print $1}'` -gt 2147483648 ]
then
echo "The directory file is larger than 2G,will be deleted directly"
`rm –rf $file`
|