sudo apt update Sudo apt install rename # ubuntu or debian
sudo yum install prename #Centos
rename [OPTIONS] perlexpr files
-v, --verbose Detailed: The plot name of the file that was successfully renamed. -0, --null When reading from STDIN, use 0 as the record separator -n, --nono Do nothing: Print the file name to be renamed, but do not rename it. -f, --force Overwrite: Allow overwriting existing files --path, --fullpath Rename full path: including any directory components. default -d, --filename, --nopath, --nofullpath Do not rename directory: only rename the file name part of the path -h, --help Help: Print feeds and options. -m, --man Manual: print the manual page -V, --version Version: displays the version number -E expression: code acting on file name You can build code repeatedly (such as "perl-e"). If there is no - e, the first parameter is used as code. -E statement: code that performs operations on file names, such as - e, but terminates at ';'
rename 'y/ /_/' *
rename 'y/A-Z/a-z/' *
rename 'y/a-z/A-Z/' *
rename 's/\.bak$//' *.bak
rename 's/\.jpe?g$/.jpg/i' *