I find myself needing to find and identify extraneous files (out of about 900K files on a 2T drive). There are lots of files that I want to keep, and I have filename patterns for these known good files. What I want is to locate those files that don't fit any of the patterns.
How do I find files not matching a list of filename patterns?
I can run find
to get a list of all files, and I could use grep -v
on the result, using a list of patterns stored in a file. Is this the canonical method, or do you have a concise way to find these non-conforming files?
Clarification - based upon the answers, here is a little more information. I expect to have numerous patterns (>20, maybe >100), I want to store them in a file and certainly want an easy way to add new ones. I would prefer to avoid directly editing a large list of find parameters (fragile), but building that list might work.