更新时间:2021-11-27 23:29:27
使用 cut 命令检索文件名的YYYY-MM-dd部分.并按如下所示使用 date 命令将其转换为time_t类型.
use cut command to retrieve YYYY-MM-dd part of filename. and use date command as following to convert it to time_t type.
日期-d"YYYY-MM-dd" +%s
date -d "YYYY-MM-dd" +%s
然后您可以比较time_t以确定应该删除哪个文件.
then you can compare time_t to determine which file should be deleted.