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 withls blue*+(.png)I'd want to rename them something likemv blue$(*)+(.png) $(1).pngexcept that doesn't work obviously. Is there syntax for these kind of variables in bash globbing or is there an easier way?
Bash Globbing Variable Substitution?
bash;shell;rename;wildcards;variable substitution
The portable way to do this isfor f in blue*.png; do mv -- $f ${f#blue}; doneAll this requires is mv and works in not just bash but also any POSIX compatible shell which supports standard POSIX parameter expansion.  No need for your system to have zsh or a particular version of rename installed.