Linux批量改文件后缀

来自三线的随记

command: rename

似乎在不同发行版OS 参数不同

Centos 7.5.1804 (Core)

[root@router yum.repos.d]# rename -V
rename from util-linux 2.23.2
[root@router yum.repos.d]# rename -h

Usage:
 rename [options] expression replacement file...

Options:
 -v, --verbose    explain what is being done
 -s, --symlink    act on symlink target

 -h, --help     display this help and exit
 -V, --version  output version information and exit

For more details see rename(1).
rename repo repo.bak ./*


Centos ?

rename .repo .repo.bak
rename -v .repo .repo.bak
rename -nv .repo .repo.bak

Ubuntu [待验证]

rename 's//.c//.h/'  ./*