Exclude list of files from find

后端 未结 6 1897
北恋
北恋 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:19

    find /var/www/test/ -type f \( -iname "*.*" ! -iname  "*.php" ! -iname "*.jpg" ! -iname "*.png"  \)
    

    The above command gives list of all files excluding files with .php, .jpg ang .png extension. This command works for me in putty.

提交回复
热议问题