linux - Exclude list of files from find -


if have list of filenames in text file want exclude when run find, how can that? example, want like:

find /dir -name "*.gz" -exclude_from skip_files 

and .gz files in /dir except files listed in skip_files. find has no -exclude_from flag. how can skip files in skip_files?

i don't think find has option this, build command using printf , exclude list:

find /dir -name "*.gz" $(printf "! -name %s " $(cat skip_files)) 

which same doing:

find /dir -name "*.gz" ! -name first_skip ! -name second_skip .... etc 

alternatively can pipe find grep:

find /dir -name "*.gz" | grep -vff skip_files 

Comments

Popular posts from this blog

javascript - Unusual behaviour when drawing lots of images onto a large canvas -

how can i manage url using .htaccess in php? -

ios - I get the error Property '...' not found on object of type '...' -