我绝不是系统管理员,但您可以考虑以下简单的shell脚本:
# Generate the date in the proper formatdiscriminant=$(date -d "30 days ago" "+%Y_%m_%d")# Find files based on the filename pattern and test against the date.find . -type f -maxdepth 1 -name "*_*_*.txt" -printf "%Pn" |while IFS= read -r FILE; do if [ "${discriminant}" ">" "${FILE%.*}" ]; then echo "${FILE}"; fidone请注意,专业人员可能会将其视为“外行”解决方案。也许使用可以更好地处理此问题
awk,但不幸的是,我不习惯使用。



