shell查找七天以前的文件

#!/bin/bash aweekago=`date -d "7 days ago" +%s` for f in $(ls) do stat -c %Y ${f} aa=`stat -c %Y "${f}"` echo "${f} createtime is ${aa}" if [ ${aweekago} -lt ${aa} ];then echo "yes" fi donehtml 轉載於:ht
相關文章
相關標籤/搜索