title: Hadoop & Bash: delete filenames matching range
body: <p>Say you have a list of files in HDFS with a common prefix and an incrementing suffix. For example,</p>
  
  <pre><code>part-1.gz, part-2.gz, part-3.gz, ..., part-50.gz
  </code></pre>
  
  <p>I only want to leave a few file in the directory, say 3. Any three files will do. The files will be used for testing so the choice of files doesn't matter.</p>
  
  <p>What's the simples &amp; fastest way to delete the 47 other files?</p>