GNU find 有没有办法找到大小为 >=
的文件?或 <=
一定尺寸?我只找到了 >
, <
, ==
运营商,例如-size +1M
, -size -1M
, -size 1M
, 分别。
在this博客,作者建议多个组合-size
参数如 find . -type f -size +1M -size -2M
.但是,这不适用于我的 find (GNU findutils) 4.4.2。
最佳答案
由于运营商<=
在逻辑上等同于 not >
(不大于),这2个运算符可以互换。在我们的示例中,要查找大小小于或等于 1M 的文件,您可以查找不大于 1M 的文件:-not -size +1M
.
同样的逻辑可以应用于 >=
使用 not <
.
关于linux - GNU 找到 : test for file size greater/smaller-equal a certain size,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13882081/