[英]Linux console script to get file size and modified date based on prefix?
[英]Linux - is there a way to get the file size of a directory BUT only including the files that have a last modified / creation date of x?
根据标题,我试图找到一种方法来获取目录的文件大小(使用 du),但只计算在特定日期之后创建(或修改)的目录中的文件。
是否可以使用命令行完成?
谢谢:)
来自@Bodo 的评论。 使用 GNU 查找:
find directory/ -type f -newermt 2021-11-25 -printf "%s\t %f\n" | \
awk '{s += $1 } END { print s }' | \
numfmt --to=iec-i
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.