环境
解法
一个for循环
remove.sh
#/bin/bash fileName=`ls --full-time | grep '2016' | awk {'print$9'}` for file in $fileName do rm -rf $file; echo "************已删除$file************" #echo $file done
授予执行权直接跑即可。
一个for循环
remove.sh
#/bin/bash fileName=`ls --full-time | grep '2016' | awk {'print$9'}` for file in $fileName do rm -rf $file; echo "************已删除$file************" #echo $file done
授予执行权直接跑即可。