find . -type f \! \( -path '*/include/*' -o -path '*/src/*' \)
Run Code Online (Sandbox Code Playgroud)
分解:
\!
正在否定该组\( ... \)
是如何做条件组的 find
-o
OR 条件如果您有足够新版本的find
,您可以通过以下方式增强它:
find . -type f -regextype posix-egrep -regex \! -path '.*/(include|src)/.*'
Run Code Online (Sandbox Code Playgroud)