title: Shell script to count files, then remove oldest files
body: <p>I am new to shell scripting, so I need some help here.  I have a directory that fills up with backups.  If I have more than 10 backup files, I would like to remove the oldest files, so that the 10 newest backup files are the only ones that are left.</p>
  
  <p>So far, I know how to count the files, which seems easy enough, but how do I then remove the oldest files, if the count is over 10?</p>
  
  <pre><code>if [ls /backups | wc -l &gt; 10]
      then
          echo "More than 10"
  fi
  </code></pre>