title: Using Wildcards with 'rename'
body: <p>I have been using the <code>rename</code> command to batch rename files.  Up to now, I have had files like:</p>
  
  <pre><code>2010.306.18.08.11.0000.BO.ADM..BHZ.SAC
  2010.306.18.08.11.0000.BO.AMM..BHZ.SAC
  2010.306.18.08.11.0000.BO.ASI..BHE.SAC
  2010.306.18.08.11.0000.BO.ASI..BHZ.SAC
  </code></pre>
  
  <p>and using <code>rename 2010.306.18.08.11.0000.BO. "" *</code> and <code>rename .. _. *</code> I have reduced them to:</p>
  
  <pre><code>ADM_.BHZ.SAC
  AMM_.BHZ.SAC
  ASI_.BHE.SAC
  ASI_.BHZ.SAC
  </code></pre>
  
  <p>which is exactly what I want.  A bit clumsy, I guess, but it works.  The problem occurs now that I have files like:</p>
  
  <pre><code>2010.306.18.06.12.8195.TW.MASB..BHE.SAC
  2010.306.18.06.14.7695.TW.CHGB..BHN.SAC
  2010.306.18.06.24.4195.TW.NNSB..BHZ.SAC
  2010.306.18.06.25.0695.TW.SSLB..BHZ.SAC
  </code></pre>
  
  <p>which exist in the same folder.  I have been trying to get the similar results to above using wildcards in the <code>rename</code> command eg. <code>rename 2010.306.18.*.*.*.*. ""</code> but this appends the first appearance of <code>2010.306.18.*.*.*.*.</code> to the beginning of all the other files - clearly not what I'm after, such that I get:</p>
  
  <pre><code>2010.306.18.06.12.8195.TW.MASB..BHE.SAC
  2010.306.18.06.12.8195.TW.MASB..BHE.SAC2010.306.18.06.14.7695.TW.CHGB..BHN.SAC
  2010.306.18.06.12.8195.TW.MASB..BHE.SAC2010.306.18.06.24.4195.TW.NNSB..BHZ.SAC
  2010.306.18.06.12.8195.TW.MASB..BHE.SAC2010.306.18.06.25.0695.TW.SSLB..BHZ.SAC
  </code></pre>
  
  <p>I guess I am not understanding a fairly fundamental principal of wildcards here so, can someone please explain why this doesn't work and what I can do to get the desired result (preferably using <code>rename</code>).</p>
  
  <hr>
  
  <p><strong>N.B.</strong></p>
  
  <p>To clarify, the output wants to be:</p>
  
  <pre><code>ADM_.BHZ.SAC
  AMM_.BHZ.SAC
  ASI_.BHE.SAC
  ASI_.BHZ.SAC
  MASB.BHE.SAC
  CHGB.BHN.SAC
  NNSB.BHZ.SAC
  SSLB.BHZ.SAC
  </code></pre>