23May/070
Batch renaming of files by extension (bash)
OK, lots of links on google, but none for doing what i want. I need to move some files like so '12%2012%20EE' >>> '12 12 EE' but i ended up ls > files.txt and editing a script in excel... Not very professoinal.
I subsequently found this:
# change .htm files to .htmlfor file in *.htm ; do mv $file `echo $file | sed 's/\(.*\.\)htm/\1html/'` ; done # change .html files to .htmfor file in *.html ; do mv $file `echo $file | sed 's/\(.*\.\)html/\1htm/'` ; done #change .html files to .shtmlfor file in *.html ; do mv $file `echo $file | sed 's/\(.*\.\)html/\1shtml/'` ; done #change .html files to phpfor file in *.html ; do mv $file `echo $file | sed 's/\(.*\.\)html/\1php/'` ; done
or:
for i in * ; domv \"$i\" \"$i.mp3\"done
But i'm still not happy












