title: Hadoop hdfs shell command for inverse pattern search
body: <p>I would like to know if we can list files in an HDFS directory with files NOT matching the given pattern. </p>
  
  <p>For instance, assume I have some files with names containing some date values [eg: 'file201606250001.csv']. </p>
  
  <p>If I need to get list of files not belonging to a date pattern, say '*20160629*', what command can I use?</p>
  
  <p>I tried to give the following command, but it still is listing all files (including the ones matching the pattern I wanted to exclude).</p>
  
  <pre><code>hdfs dfs -ls /test/* | grep -v '*20160629*'
  </code></pre>
  
  <p>I tried the solution given <a href="https://stackoverflow.com/a/8525459/3824296">here</a>, but still it returns all files.</p>