http://c.biancheng.net/view/779.html
http://c.biancheng.net/view/779.html
https://blog.csdn.net/weixin_44297303/article/details/88090744
- 按照文件类型搜索
-type d:查找目录
-type f:查找普通文件
-type l:查找软链接文件
-
字符串过滤查找
https://blog.csdn.net/weixin_40918067/article/details/117868378 -
按修改时间查找
https://blog.csdn.net/answer100answer/article/details/86423411
find path -mtime +n
: 列出在n天之前(不含n天本身)被更改过内容的文件名
排除(-not)
- 过滤指定后缀的文件
find /path/to/search -type f -not \( -name "*.txt" -o -name "*.pdf" -o -name "*.jpg" \)
/path/to/search 是你想要搜索的目录。
-type f 表示你只搜索文件。
-not 表示逻辑非,用于排除指定的文件。
\( 和 \) 用于分组条件。
-name "*.txt"、-name "*.pdf" 和 -name "*.jpg" 分别指定要排除的文件后缀。
-o 表示逻辑或,连接多个条件。
- 过滤排除二进制文件
find . -type f -not -executable
0 条评论