linux中文件重命名
Renaming multiple parts always seems a difficult job and renaming can be done only senior system administrator. Actually it is very easy as long as the situation is not so complex.
重命名多个部分总是很困难,重命名只能由高级系统管理员来完成。 实际上,只要情况不那么复杂,这是非常容易的。
重命名命令 (Rename Command)
Rename command will change files names according to the rules specified. Rename command also supports perlexpr. Rename is also known with rename.ul in some distributions but recently rename command can be used.
重命名命令将根据指定的规则更改文件名。 重命名命令还支持perlexpr。 在某些发行版中,Rename也以rename.ul闻名,但最近可以使用rename命令。
$ rename ".jpg" ".jpeg" "*.jpg"
Rename files specified *.jpg and change .jpg to the .jpeg
重命名指定的文件* .jpg并将.jpg更改为。 jpeg
将大写文件名更改为小写 (Change Uppercase Filenames To Lowercase)
Another useful usage of rename is converting names to upper and lowercase we will see in this example how to convert uppercase to lowercase
重命名的另一个有用用法是将名称转换为大写和小写,在此示例中,我们将看到如何将大写转换为小写
$ rename 'y/A-Z/a-z/' *
将小写文件名更改为大写 (Change Lowercase File Names To Uppercase)
In contrast to the previous example, we will convert lowercase names to the uppercase during the rename operation.
与前面的示例相反,我们将在重命名操作期间将小写名称转换为大写。
$ rename 'y/a-z/A-Z/' *
使用MMV (Using Mmv)
mmv
is another command used to move, copy, append and link multiple files with wildcard patterns. Mmv makes these operations safely without harming any files. Mmv supports big files but don does not support sparse files for append. mmv
stands for Multi Move
mmv
是另一个用于使用通配符模式移动,复制,附加和链接多个文件的命令。 Mmv可以安全地执行这些操作,而不会损坏任何文件。 MMV支持大文件,但不支持稀疏文件。 mmv
代表Multi Move
$ mmv '*.jpeg' '#1.jpg'
*.jpeg is the files those will be selected for rename
* .jpeg是将要重命名的文件
#1 is the name part of the files select and do not includes the extension
#1是文件选择的名称部分,不包含扩展名
.jpg is the extension will be added
.jpg是扩展名
linux中文件重命名