Rename multiple files. Note: this page refers to the command from the
perl-rename
Arch Linux package. More information: https://manned.org/rename.
rename 's/foo/bar/' *
rename -n 's/foo/bar/' *
rename -f 's/foo/bar/' *
-f
in case-insensitive filesystems to prevent “already exists” errors):rename 'y/A-Z/a-z/' *
rename 's/\s+/_/g' *