title: bash remove duplicate files based on sequence number at the end
body: <p>Hy,</p>
  
  <p>I'm trying to delete some duplicate files in a folder (aprox. 50000 files) that have the same name but the only thing that differs is a sequence number at the end :</p>
  
  <pre><code>aaaaaaaaaa.ext.84837384
  aaaaaaaaaa.ext.44549388
  aaaaaaaaaa.ext.22134455
  bbbbbbbbbb.ext.11244355
  bbbbbbbbbb.ext.88392456
  </code></pre>
  
  <p>I want to delete the duplicate files based on minimum of sequence number (.22134455 to be hold for aaaaaaaaaa.ext and .11244355 to be hold for bbbbbbbbbbb)</p>
  
  <p>I mentioned that i have a lot of files in the folder ~ 50.000 files and sorting and filtering based on size and md5 would take like forever. </p>
  
  <p>I tried <code>find -not -empty -type f -printf "%s\n" | sort -rn | uniq -d | xargs -I{} -n1 find -type f -size {}c -print0 | xargs -0 md5sum | sort | uniq -w32 --all-repeated=separate</code> but is taking forever.</p>
  
  <p>Thank you very much</p>