3 回答

TA贡献1842条经验 获得超12个赞
-prune
misc
-path ./misc -prune -o
find . -path ./misc -prune -o -name '*.txt' -print
find . -type d \( -path dir1 -o -path dir2 -o -path dir3 \) -prune -o -print
find
-path dir1 -o -path dir2 -o -path dir3
type -d
.
-o print

TA贡献1817条经验 获得超14个赞
-prune
find -name "*.js" -not -path "./directory/*"
警告:

TA贡献1797条经验 获得超6个赞
find build -not \( -path build/external -prune \) -name \*.js# you can also exclude multiple pathsfind build -not \( -path build/external -prune \) -not \( -path build/blog -prune \) -name \*.js
重要说明:-path
find
find
/完整/路径/-not \( -path
/完整/路径/排除/此-prune ...
\(
\)
build/external
-not
find
-not
-prune
-prune
注[1]/tmp/foo/bar
find /tmp \(...
-path /tmp/foo/bar
cd /tmp; find . \(...
-path ./foo/bar
.
- 3 回答
- 0 关注
- 504 浏览
添加回答
举报