title: command line bulk rename
body: <p>I have files in multiple subfolders, I want to move them all to one folder.
  Then I like to rename those files.</p>
  
  <pre><code>/foo/A1000-foobar1412.jpg
  /foo/A1000-foobar213.jpg
  /foo/A1000-foobar314.jpg
  /foo1/B1001-foobar113.jpg
  /foo2/C1002-foobar1123.jpg
  /foo2/C1002-foobar24234.jpg
  </code></pre>
  
  <p>What I would like to get is:</p>
  
  <pre><code>../bar/A1000-1.jpg
  ../bar/A1000-2.jpg
  ../bar/A1000-3.jpg
  ../bar/B1001-1.jpg
  ../bar/C1002-1.jpg
  ../bar/C1002-2.jpg
  </code></pre>
  
  <p>So what I do so far is:</p>
  
  <pre><code>find . -name "*.jpg" -exec mv {} ../bar/ \;
  </code></pre>
  
  <p>But now I'm stuck at renaming the files.</p>