shell练习-对指定目录下的符合条件的文件执行操作
编写个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!"
页:
[1]