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

授予执行权直接跑即可。

原文地址:https://www.cnblogs.com/chenglee/p/8872322.html