linux删除指定创建时间文件(文件夹)脚本

环境

解法

一个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

授予执行权直接跑即可。

 

posted @ 2018-04-18 10:06  扶苏公子x  阅读(3830)  评论(0)    收藏  举报