This is similar to the comment from @siwei-shen but you need the -o
flag to do multiple patterns. The -o
flag stands for 'or'
find . -type f -not -name '*ignore1' -o -not -name '*ignore2' | xargs rm
This is similar to the comment from @siwei-shen but you need the -o
flag to do multiple patterns. The -o
flag stands for 'or'
find . -type f -not -name '*ignore1' -o -not -name '*ignore2' | xargs rm