Artificial intelligent assistant

How to exclude multiple folders matched by wildcards from a find search I wish to find all files and folders except/excluding folders starting with 'tmp' and 'logs' under '/app/test' directory using `prune` Thus I tried the below command. find /app/test -type d \( ! -name logs* \) -o \( ! -name log \) -o \( ! -name tmp* \) -o \( ! -name tmp \) -prune | tee /tmp/findall.log But I see top folder included in the find result like below: /app/test/Admin/tmp/data/pm.trp /app/test/Admin/tmp/wond/iqc.log etc ... Can you please suggest?

Apart from not quoting words that contain filename globbing characters, you also have inverted the sense of all `-name` tests, resulting in pruning the names that do _not_ match these names and patterns from the search tree.

Instead:


find /app/test -type d \
\( -name 'logs*' -o -name log -o -name 'tmp*' -o -name tmp \) -prune -o \
-print | tee /tmp/findall.log


The `-prune` test would, without `-print`, still print out pathnames of things matching up to that point.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy b9e2afdb856a69f325a8fc65660639f3