for file in $1/*
do
if [ -f $file ]
then
SUFFIX=${file#*BK}
PREFIX=${SUFFIX%%_*}
CURRENT=`date -d -7day +%Y%m%d`
if [[ $CURRENT -gt $PREFIX ]]
then
rm -rf $file
fi
fi
done
#!bin/sh
for file in ./*
do
if test -f $file
then
echo $file 是文件
fi
if test -d $file
then
echo $file 是目录
fi
done
if --else 类型: #!bin/sh
for file in ./*
do
if test -f $file
then
echo $file 是文件
else
echo $file 是目录
fi
done

最新文章

  1. iOS and JAVA 的 RSA 加密解密 (转载整理 )
  2. mysql 存储引擎
  3. 关于CSS三列Float布局任务
  4. redis-cluster 单个节点不可用
  5. serialVersionUID的作用
  6. 调用MyFocus库,简单实现二十几种轮播效果
  7. Swift3.0语言教程比较、判断字符串
  8. DependencyProperties or INotifyPropertyChanged ?
  9. Dedecms最新版本存储型XSS
  10. Python字典笔记
  11. dev中gridview控件 z
  12. jQuery停止事件冒泡
  13. innerhtml和innertext的用法以及区别
  14. android adb 不同的方式使用特定的解释
  15. sqoop: mysql to hive
  16. xssgame挑战wp
  17. 《java入门第一季》之面向对象(private关键字与封装概念的初探)
  18. 前端css
  19. Mysql 字符串分隔函数
  20. Unbuntu 16.04 英文环境安装中文输入法

热门文章

  1. Ubuntu无法进入图形界面的解决办法
  2. 使用infinite-scroll实现Ghost博文列表的滚动加载
  3. Hadoop笔记之搭建环境
  4. Python作业选课系统(第六周)
  5. discuz2.5登录后台闪退的解决办法
  6. VideoJS 与 Framework7 中 fastclick 冲突问题
  7. mysql数据库单表增删改查命令
  8. MongoDB之安装和基本使用(一)
  9. RTC
  10. bootstrap table 双击可编辑,添加、删除行