find
在指定目录树下递归查找文件或目录。 另请参阅:
fd。 更多信息:https://manned.org/find。
- 通过扩展名查找文件:
find -name ''
- 查找匹配多个路径或名称模式的文件:
find -path '' -or -name ''
- 查找匹配指定名称的目录,不区分大小写:
find -type d -iname ''
- 查找匹配指定模式的文件,排除特定路径:
find -name '' -not -path ''
- 查找符合指定大小范围的文件,将递归深度限制为 "1":
find -maxdepth 1 -size -size
- 对每个文件运行命令(在命令中使用
{}代表当前文件):
find -name '' -exec \;
- 查找最近 7 天修改的文件:
find -daystart -mtime -
- 查找空(0 字节)的文件并删除:
find -type -empty -delete
来源:tldr-pages contributors · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。
