<br><br><div><span class="gmail_quote">On 12/2/05, <b class="gmail_sendername">Stephen Ryan</b> <<a href="mailto:taketwoaspirin@gmail.com">taketwoaspirin@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><br><div><span class="q"><span class="gmail_quote">On 12/2/05, <b class="gmail_sendername">Wade Smart</b> <<a href="mailto:wade@wadesmart.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
wade@wadesmart.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
12022005 1312 GMT-5<br><br>I have a odd situation where I have to rename 130 picture files from a<br>random number to 1.jpg, 2.jpg, etc. Is there anyway to automate that?<br>Quickly!<br><br>Wade</blockquote></span><div><br>

Yes, there is.  If the files are all currently in the same
directory, and are all named something_or_other.jpg, the following will
rename them to 1.jpg, 2.jpg, in a random-ish order:<br>
<br>
$ for i in *.jpg ; do mv $i $((++c)).jpg ; done<br>
$ unset c<br>
$ unset i<br>
<br>
The "for i in FOO ; do BAR ; done" part runs a particular command once
for each file specified by FOO.  The precise command is specified
by BAR, and it renames (mv) that file to a number followed by ".jpg";
it also adds one to the number so that each file gets a different
number.<br>
<br>
"unset c" and "unset i" just clear the values of those two shell
variables; if you close the terminal window afterwards, you won't need
to run those two commands.<br>
<br>
Holler if you need more help, or if I misunderstood your problem.<br>
</div></div>

</blockquote></div><br>
One other thing: if your files aren't completely randomly-named and
there's a piece of the filename that you need to keep, (i.e., you want
to rename DSCF00012.jpg to 12.jpg) check out mmv (it's in universe).<br>