title: How do I combine my find and grep command to delete the files?
body: <p>I currently have the following command which produces a list of files:</p>
  
  <pre><code>find . -type f | grep -i -f ./remove_list
  </code></pre>
  
  <p>This command reads a file called "remove_list" which contains a list of terms (actually regex expressions) I want to find in the output from the find command.</p>
  
  <p>The above command works fine but I don't understand how to now delete each of the files found (especially as some of them will contain spaces).</p>
  
  <p>I thought I could do something like this:</p>
  
  <pre><code>find . -type f -print0 | grep -i -f ./remove_list | xargs -0 rm
  </code></pre>
  
  <p>As I understand it the -print0 and -0 are necessary to handle filenames with spaces in them but now when I try to run the command I get an error message stating "Binary file (standard input) matches".</p>
  
  <p>How do I read in a number of (regex) terms from a file so that they can be used as arguments in the find statement?</p>