Using wildcards to do mass renaming? [duplicate]

Wildcards won't do it. Look at the result of echo mv 1* 2*. A better way is (man rename):

rename 's/^1/2/' 1*

You can use wildcards in that way if you install mmv (although they must be quoted - so that they are interpreted by mmv itself rather than the shell), and the replacement wildcard takes the form #n to re-substitute the nth wildcard from the pattern:

Usage: mmv [-m|x|r|c|o|a|l] [-h] [-d|p] [-g|t] [-v|n] [from to]

Use #[l|u]N in the ``to'' pattern to get the [lowercase|uppercase of the]
string matched by the N'th ``from'' pattern wildcard.

A ``from'' pattern containing wildcards should be quoted when given
on the command line. Also you may need to quote ``to'' pattern.

Use -- as the end of options.

So for example

$ mmv -n -- '1*' 2#1
1.sh -> 2.sh : delete old 2.sh? n
1-chart.jpg -> 2-chart.jpg
1.4.5.txt -> 2.4.5.txt
1.csv -> 2.csv

(The -n option allows you to do a dry-run - remove it to actually rename the files.)