title: Rename several files in the BASH
body: <p>I would like to rename files numbering: I have a files with '???'  format I need to put them in '????'.</p>
  
  <pre><code>myfile_100_asd_4 to myfile_0100_asd_4
  </code></pre>
  
  <p>Thanks
  Arman.</p>
  
  <p>Not so elegant SOLUTION:</p>
  
  <pre><code>#/bin/bash
  snap=`ls -t *_???`
  c=26 
  for k in $snap 
  do 
  
       end=${k}
       echo  mv  $k ${k%_*}_0${k##*_}_asd_4
       (( c=c-1 ))
  
  done
  </code></pre>
  
  <p>This works for me because I have  myfile_100 files as well.</p>