[NTLUG:Discuss] batch file rename

Rick Renshaw bofh69 at yahoo.com
Tue Sep 9 06:29:00 CDT 2014


All you're doing is trying to exectute the new names.  Try something like this:

for file in *.mp3;do
  newname=`sed s/CCC-\([0-9]+\)-\([0-9]+\)-\([0-9]+\).mp3/\3\1\2\.mp3/`
  mv $file $newname
done


More information about the Discuss mailing list