Tal vez necesite usar el comando perl rename. En mi casilla CentOS, se llama 'prename'.
$ ls
IMG_1.JPG IMG_2.JPG IMG_3.JPG
$ prename 's/^IMG/img/;s/\.JPG$/\.jpg/' *JPG
$ ls
img_1.jpg img_2.jpg img_3.jpg
$
$ prename -h
Usage: prename [OPTION]... PERLEXPR FILE...
Rename FILE(s) using PERLEXPR on each filename.
-b, --backup make backup before removal
-B, --prefix=SUFFIX set backup filename prefix
-f, --force remove existing destinations, never prompt
-i, --interactive prompt before overwrite
-l, --link-only link file instead of reame
-n, --just-print, --dry-run don't rename, implies --verbose
-v, --verbose explain what is being done
-V, --version-control=METHOD override the usual version control
-Y, --basename-prefix=PREFIX set backup filename basename prefix
-z, -S, --suffix=SUFFIX set backup filename suffix
--help display this help and exit
--version output version information and exit
The backup suffix is ~, unless set with SIMPLE_BACKUP_SUFFIX. The
version control may be set with VERSION_CONTROL, values are:
numbered, t make numbered backups
existing, nil numbered if numbered backups exist, simple otherwise
simple, never always make simple backups
Report bugs to pederst@cpan.org
$
Si desea utilizar el rename
comando tonto de util-linux
(a veces llamado rename.ul
), tal vez necesite hacerlo en dos pasos, por ejemplo
$ ls
IMG_1.JPG IMG_2.JPG IMG_3.JPG
$ rename IMG img *JPG
$ rename JPG jpg *JPG
$ ls
img_1.jpg img_2.jpg img_3.jpg
$
perl
rename
es anterior a la tonta que serename
encuentra en util-linux que usted llama simplemente viejorename
. Incluso es anterior a Linux.