title: Batch renaming files in command line and Xargs
body: <p>So, I have the following structure:</p>
  
  <pre><code>.
  ..
  a.png
  b.png 
  c.png
  </code></pre>
  
  <p>I ran a command to resize them</p>
  
  <pre><code>ls | xargs -I xx convert xx -resize xx.jpg
  </code></pre>
  
  <p>Now my dir looks like this</p>
  
  <pre><code>.
  ..
  a.png.jpg
  a.png
  b.png.jpg
  b.png
  c.png.jpg
  c.png
  </code></pre>
  
  <p>The firs question is, how do i rename the file so that I can just have one extension. Not two. (basically, how do I clean up my original mistake)?<br/><br/>
  The second question is, in the future, using xargs, how do I change the extension of the file simular to second command?</p>