linux - GNU 找到 : test for file size greater/smaller-equal a certain size

标签 linux find

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/

相关文章:

javascript - $ionicDevice.ready() 在 Linux 上构建时不会触发

linux - 如何使用 sed 替换字符串中的多个字符?

find - 在子目录上使用 find 并创建指向所有文件的符号链接(symbolic link)

shell - Unix find 命令,什么是{}和\;为了?

Linux:查找并执行并发 xterm

linux - 在 sed 中捕获一组数字

linux - disown 和注销后是否可以看到 stdout 的输出?

linux - nasm 相当于设置指令

linux - 将多个文件合并为一个文件,文件名位于数据之前

grails - 如何获取在grails中具有特定角色的所有用户