更新时间:2023-08-29 12:53:10
找到
是这类任务的常用工具:
find
is the common tool for this kind of task :
find ./my_dir/* -mtime +10 -type f -delete
说明
./ MY_DIR
目录(用自己的替换) -mtime +10
早于10天型的F
仅文件 -delete
毫不奇怪。删除前测试./my_dir
your directory (replace with your own)-mtime +10
older than 10 days-type f
only files-delete
no surprise. Remove it to test before和照顾的 ./ MY_DIR
的存在是为了避免不良的惊喜!
And take care that ./my_dir
exists to avoid bad surprises !