3 回答

TA貢獻1842條經驗 獲得超13個贊
-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 關注
- 535 瀏覽
添加回答
舉報