title: Is there any trivial way to 'delete by date' using ´rm'- in bash?
body: <p>I noticed today (after ~8 years of happily hacking away at bash) that there is no trivial way to 'delete by date' using ´rm'. The solution is therefore to pipe stuff around a combination of commands like rm, ls, find, awk and sed.</p>
  
  <p>Say for example I wanted to delete every file in the working directory from 2009, what would be the typical approach?</p>
  
  <p>I came up with the following, which is butt-ugly and should only be run if 'rm' is set to skip over directories (otherwise you will delete the parent directory):</p>
  
  <pre><code>ls -la | awk '{if (substr($6,0,5)==2009) print $8}' | xargs rm
  </code></pre>
  
  <p>Points for both the most elegant and the most outrageously over-engineered solutions.</p>