rename命令的格式:
rename [ -v ] [ -n ] [ -f ] perlexpr [ files ]
-v, --verboseVerbose: print names of files successfully renamed.
-n, --no-actNo Action: show what files would have been renamed.
-f, --forceForce: overwrite existing files.
简单的rename使用命令:
字母的替换
rename "s/AA/aa/" * //把文件名中的AA替换成aa
修改文件的后缀
rename "s/.html/.php/" * //把.html 后缀的改成 .php后缀
批量添加文件后缀
rename "s/$/.txt/" * //把所有的文件名都以txt结尾
批量删除文件名
rename "s/.txt//" * //把所有以.txt结尾的文件名的.txt删掉一条命令:
rename "s/.JPG/.jpg/" *
阅读(1232) | 评论(0) | 转发(0) |