The two commands below are yielding exactly the same file list in bash under cygwin:
find ../../../../.. -name "*.o" -and -path "*/common/*"
find ../../../../.. -name "*.o" -and -path "*/common/*" -prune
This list includes files such as:
../../../../../platform/abc/common/ppng.o
../../../../../platform/abc/common/variant/pxx.o
The list does not include any files without “common” in their pathnames.
What I’m trying to do is find (and ultimately eliminate) object files in all directories but any that have a “common” directory component. I’ve tried about 25 other combinations without luck.
Any pointers?
afaik, -path doesn’t take regular expressions. I think what you want to do is find all your object files (
.*.o) and exclude all the common directories (.*/common/.*):You can make it all case insensitive with
-iregexif needed.