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.
find files not matching list of filename patterns
bash;find;perl
Since you mention Perl...#!/usr/bin/perluse strict;use warnings;use File::Find qw{find};my %patterns;while (<>) {  chomp;  $patterns{$_}++;}die No pattern supplied\n unless keys %patterns;find(     sub{           my $matches_a_pattern=0;           for my $pattern (keys %patterns){               my $glob_pattern = $pattern;               for($glob_pattern){                   s/\./\\./g;                   s/\*/.*/g;                   s/\?/./g;               }               $matches_a_pattern++ if ( /\Q$pattern\E/ or /$glob_pattern/);           }           print $File::Find::name\n unless $matches_a_pattern;     }    , '.' )Invoke this as /path/to/my/script file_with_patternsReplace the . at the end with the top of the tree you want to walk.