Possible Duplicate:
Batch renaming files
I want to rename files using their existing name as a base for the new one.
So if I can ls
these files with
ls blue*+(.png)
I'd want to rename them something like
mv blue$(*)+(.png) $(1).png
except that doesn't work obviously. Is there syntax for these kind of variables in bash globbing or is there an easier way?
${f#blue}
part removes theblue
prefix from the beginning of$f
. See the link I added in the edit for more details. – jw013 Nov 26 '12 at 21:33