title: grep with multiple NOT and AND operators
body: <p>I am looking for a multiple grep with NOT and AND conditions. I have a directory with with txt files and some csv files which have the date included in the filename. I want to delete the csv files that do not include today’s date. The directory does include csv files with previous dates. So I am trying the code below in bash</p>
  
  <pre><code>#!/bin/bash
  now=$(date "+%m-%d-%Y")
  dir="/var/tmp/"
  for f in "$dir"/*; do
     ls -1 | grep -v *$now* | grep *csv* | xargs rm -f
  done
  </code></pre>
  
  <p>This is not deleting anything. If I take out the grep <em>csv</em> operator then it deletes the text files. Only the CSV files have dates on them, the text files don’t. Please advise.</p>