How to get a file 'zlib.h' in an entire directory with an excluded directory specified lives under that starting directory by using find command, as it failed on:
$ find . -name 'zlib.h' -a -ipath 'CHROME.TMP' -prune -o -print
it'll just list entirely up
RudiC
March 1, 2018, 2:27am
2
-o -print
will print all files regardless of the tests executed before.
If -prune doesn't work for you, this will:
find -name "*.js" -not -path "./directory/*"
---------- Post updated at 05:13 AM ---------- Previous update was at 05:12 AM ----------
find . -name '*.js' -and -not -path directory
---------- Post updated at 05:14 AM ---------- Previous update was at 05:13 AM ----------
This is the format I used to exclude some paths:
$ find ./ -type f -name "pattern" ! -path "excluded path" ! -path "excluded path"
I used this to find all files not in ".*" paths:
$ find ./ -type f -name "*" ! -path "./.*" ! -path "./*/.*"