【发布时间】:2022-01-02 04:17:21
【问题描述】:
使用以下方法搜索整个系统:
find / -type f -size +100M -exec ls -lh {} \; | awk '{ print $9 "|| Size : " $5 }'
如何省略目录?我看到 -prune -o,但我不确定如何格式化选项。
【问题讨论】:
-
Stack Overflow 用于编程问题,而不是关于使用或配置 Unix 及其实用程序的问题。 Unix & Linux 或 Super User 将是解决此类问题的更好地方。
-
find / -type d -name 'directory_to_omit' -prune -o -type f ... -
Don't use
lsin scripts. 如果你真的在Linux上,你想使用find的-printf谓词来打印出你想要的字段。
标签: linux bash shell search find