Exclude list of files from find

后端 未结 6 1894
北恋
北恋 2021-01-31 07:43

If I have a list of filenames in a text file that I want to exclude when I run find, how can I do that? For example, I want to do something like:

fi         


        
6条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-31 08:13

    This is what i usually do to remove some files from the result (In this case i looked for all text files but wasn't interested in a bunch of valgrind memcheck reports we have here and there):

    find . -type f -name '*.txt' ! -name '*mem*.txt'
    

    It seems to be working.

提交回复
热议问题