title: Using sed to modify filenames
body: <p>Since I don't have <code>rename</code>, I would like to use <code>sed</code> to modify 192 file names. Specifically, I want to remove the last 5 characters before the file extension; the first character is an <code>_</code> and the other 4 are random alphanumeric strings with letters in small or large caps. Example of filenames now:</p>
  
  <pre><code>Pyrrhocoridae_Pyrrhocorinae_Pyrrhocorini_Dysdercus_mimus_CMF_0110_S42_L005_R1_001_prinseq_good_30Nd.fastq
  Pyrrhocoridae_Pyrrhocorinae_Pyrrhocorini_Dysdercus_mimus_CMF_0110_S42_L005_R2_001_prinseq_good_GyUj.fastq
  Pyrrhocoridae_Pyrrhocorinae_Pyrrhocorini_Dysdercus_suturellus_CMF_0305_S71_L005_R1_001_prinseq_good_M99E.fastq
  Pyrrhocoridae_Pyrrhocorinae_Pyrrhocorini_Dysdercus_suturellus_CMF_0305_S71_L005_R2_001_prinseq_good_HZrr.fastq
  Rhopalidae_Rhopalinae_Harmostini_Harmostes_sp_CMF_0401_S87_L005_R1_001_prinseq_good_96CG.fastq
  Rhopalidae_Rhopalinae_Harmostini_Harmostes_sp_CMF_0401_S87_L005_R2_001_prinseq_good_stNk.fastq
  </code></pre>
  
  <p>What I'd like to do with a <code>sed</code> script:</p>
  
  <pre><code>Pyrrhocoridae_Pyrrhocorinae_Pyrrhocorini_Dysdercus_mimus_CMF_0110_S42_L005_R1_001_prinseq_good.fastq
  Pyrrhocoridae_Pyrrhocorinae_Pyrrhocorini_Dysdercus_mimus_CMF_0110_S42_L005_R2_001_prinseq_good.fastq
  Pyrrhocoridae_Pyrrhocorinae_Pyrrhocorini_Dysdercus_suturellus_CMF_0305_S71_L005_R1_001_prinseq_good.fastq
  Pyrrhocoridae_Pyrrhocorinae_Pyrrhocorini_Dysdercus_suturellus_CMF_0305_S71_L005_R2_001_prinseq_good.fastq
  Rhopalidae_Rhopalinae_Harmostini_Harmostes_sp_CMF_0401_S87_L005_R1_001_prinseq_good.fastq
  Rhopalidae_Rhopalinae_Harmostini_Harmostes_sp_CMF_0401_S87_L005_R2_001_prinseq_good.fastq
  </code></pre>
  
  <p>I've tried <code>sed -r 's/good_(.)+.fastq/good.fastq/'</code> but nothing seems to happen.</p>