编写个shell脚本将当前目录下大于10K的文件,然后删除
#!/bin/bash
#author: liqilong
#date: 2016-08-26
#Decs: find the file (if they more than 10K)and remove them .
for Filename in `ls -l|awk '$5 > 10240 {print $9}'`
do
rm -rf $Filename
done
echo "OK!"
本文共 275 字,大约阅读时间需要 1 分钟。
编写个shell脚本将当前目录下大于10K的文件,然后删除
#!/bin/bash
#author: liqilong
#date: 2016-08-26
#Decs: find the file (if they more than 10K)and remove them .
for Filename in `ls -l|awk '$5 > 10240 {print $9}'`
do
rm -rf $Filename
done
echo "OK!"
转载于:https://blog.51cto.com/liqilong2010/1843025