doc: update find.md (#148)

This commit is contained in:
ryanhex53 2022-11-20 02:48:17 +08:00 committed by GitHub
parent 2843f35c9a
commit 436e73a3a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -196,11 +196,11 @@ $ find /home -user tecmint -iname "*.txt"
### 多个文件名
```shell
$ find . -type f \( -name "*.sh" -o -name "*.txt" \)
$ find . -type f \( -name "*.sh" -or -name "*.txt" \)
```
<!--rehype:className=wrap-text -->
查找带有 `.sh` `.txt` 扩展名的文件
查找带有 `.sh` `.txt` 扩展名的文件
### 多个目录
@ -388,3 +388,11 @@ $ find / -type d -perm 777 -print -exec chmod 755 {} \;
$ find . -type f -name "*.java" | xargs tar cvf myfile.tar
$ find . -type f -name "*.java" | xargs tar rvf myfile.tar
```
### 查找并排除目录
查找当前目录及子目录中的所有`js`文件,但是排除掉`node_modules`目录中的
```shell
$ find . -type f -name "*.js" -not -path "./node_modules/*"
```