title: Iterate over folders and move files up one level
body: <p>I have a directory structure that looks like this:</p>
  
  <pre><code>/images
    /1
      /.tmp
        image1.jpg
        image2.jpg
    /2
      .tmp
        image1.jpg
        image2.jpg
        image3.jpg
    /3
      .tmp
        image1.jpg
        image2.jpg
  </code></pre>
  
  <p>What I need is to move all of those files in .tmp up one level, so their paths are <code>images/1/image1.jpg</code> rather than <code>images/1/.tmp/image1.jpg</code>. The issue is that I have hundreds or thousands of these numbered folders, so doing it by hand would take forever.</p>
  
  <p>Is there an OS X or Unix shell command that I could iterate over each /.tmp  folder and move the contents up a level, or something like:</p>
  
  <pre><code>mv images/*/.tmp/* images/&lt; the current dir being iterated over&gt;/*
  </code></pre>