首页 > 编程知识 正文

shell重命名文件指令,python 重命名

时间:2023-05-05 13:10:23 阅读:20856 作者:2991

在linux上重命名文件

renamingmultiplepartsalwaysseemsadifficultjobandrenamingcanbedoneonlyseniorsystemadministrator.actuallyitisveryeasyaslongastongasttor

重命名许多部分总是很困难,只有高级系统管理员才能重命名它们。 事实上,这非常简单,除非情况不是那么复杂。

重命名命令(Rename Command ) renamecommandwillchangefilesnamesaccordingtotherulesspecified.renamecommandalsosupportsperlexpr.renameisalsoknownwithrenamenamexpr

重命名命令根据指定的规则重命名文件。 重命名命令还支持perlexpr。 在某些版本中,Rename也以Rename.ul而闻名,但最近可以使用Rename命令。

$ rename '.jpg '.JPEG ' ' *.jpg ' renamefilesspecified 3358 www.Sina.com/and change 3358 ww.Sina.com/to the .

将指定文件重命名为 *.jpg,并将.jpg重命名为。jpeg

将大写文件名更改为小写(changeuppercasefilenamestolowercase ) anotherusefulusageofrenameisconvertingnamestoupperandlowercasewillsersese

将名称转换为大小写也是一种方便的使用方法。 此示例说明如何将大小写转换为小写

$ rename 'y/A-Z/a-z/' *大写文件名(changelowercasefilenamestouppercase (incontrasttothepreviousexample,wewilllll

与上一个示例相反,在重命名操作中将小写名称转换为大写。

$ rename ' y/a-z/a-z/' * mmv (using mmv ) mmvis another command used to move,copy, appendandlinkmultiplefileswithwildcardpatterns.mmvmakestheseoperationssafelywithoutharminganyfiles.mmvsupportsbigfilesbutdbutddd

mv是用于使用通配符模式移动、复制、附加和链接多个文件的另一个命令。 mv可以安全地执行这些操作,而不会损坏文件。 mv支持大文件,但不支持稀疏文件。 mv表示多移动

$ mmv ' *.JPEG ' #1. jpg ' http://www.Sina.com/isthefilesthosewillbeselectedforrename

* .jpg是要重命名的文件

33558 www.Sina.com/isthenamepartofthefilesselectanddonotincludestheextension

.jpg是文件选择的名称部分,不包含扩展名

33558 www.Sina.com/istheextensionwillbeadded

jpeg是扩展名

Using Mmv是mmv.u 298 d 74 f 715492250 fc 62b5F3 e 630 c 999, u 298 d 74 f 74 f 715492250 fc 62b5F3 e 630 c 999.post imageurl, u298d74f715492250fc660

red-text-area { min-height: 80px; position: relative; } .u298d74f715492250fc62b5f3e630c999 , .u298d74f715492250fc62b5f3e630c999:hover , .u298d74f715492250fc62b5f3e630c999:visited , .u298d74f715492250fc62b5f3e630c999:active { border:0!important; } .u298d74f715492250fc62b5f3e630c999 .clearfix:after { content: ""; display: table; clear: both; } .u298d74f715492250fc62b5f3e630c999 { display: block; transition: background-color 250ms; webkit-transition: background-color 250ms; width: 100%; opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #ECF0F1; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); } .u298d74f715492250fc62b5f3e630c999:active , .u298d74f715492250fc62b5f3e630c999:hover { opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #D35400; } .u298d74f715492250fc62b5f3e630c999 .centered-text-area { width: 100%; position: relative; } .u298d74f715492250fc62b5f3e630c999 .ctaText { border-bottom: 0 solid #fff; color: #3498DB; font-size: 16px; font-weight: bold; margin: 0; padding: 0; text-decoration: underline; } .u298d74f715492250fc62b5f3e630c999 .postTitle { color: #27AE60; font-size: 16px; font-weight: 600; margin: 0; padding: 0; width: 100%; } .u298d74f715492250fc62b5f3e630c999 .ctaButton { background-color: #e6e6e6!important; color: #3498DB; border: none; border-radius: 3px; box-shadow: none; font-size: 14px; font-weight: bold; line-height: 26px; moz-border-radius: 3px; text-align: center; text-decoration: none; text-shadow: none; width: 80px; min-height: 80px; background: url(https://www.poftut.com/wp-content/plugins/intelly-related-posts/assets/images/simple-arrow.png)no-repeat; position: absolute; right: 0; top: 0; } .u298d74f715492250fc62b5f3e630c999:hover .ctaButton { background-color: #E67E22!important; } .u298d74f715492250fc62b5f3e630c999 .centered-text { display: table; height: 80px; padding-left: 18px; top: 0; } .u298d74f715492250fc62b5f3e630c999 .u298d74f715492250fc62b5f3e630c999-content { display: table-cell; margin: 0; padding: 0; padding-right: 108px; position: relative; vertical-align: middle; width: 100%; } .u298d74f715492250fc62b5f3e630c999:after { content: ""; display: block; clear: both; } LEARN MORE  Linux mv Command Tutorial .u298d74f715492250fc62b5f3e630c999 , .u298d74f715492250fc62b5f3e630c999 .postImageUrl , .u298d74f715492250fc62b5f3e630c999 .centered-text-area { min-height: 80px; position: relative; } .u298d74f715492250fc62b5f3e630c999 , .u298d74f715492250fc62b5f3e630c999:hover , .u298d74f715492250fc62b5f3e630c999:visited , .u298d74f715492250fc62b5f3e630c999:active { border:0!important; } .u298d74f715492250fc62b5f3e630c999 .clearfix:after { content: ""; display: table; clear: both; } .u298d74f715492250fc62b5f3e630c999 { display: block; transition: background-color 250ms; webkit-transition: background-color 250ms; width: 100%; opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #ECF0F1; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -o-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.17); } .u298d74f715492250fc62b5f3e630c999:active , .u298d74f715492250fc62b5f3e630c999:hover { opacity: 1; transition: opacity 250ms; webkit-transition: opacity 250ms; background-color: #D35400; } .u298d74f715492250fc62b5f3e630c999 .centered-text-area { width: 100%; position: relative; } .u298d74f715492250fc62b5f3e630c999 .ctaText { border-bottom: 0 solid #fff; color: #3498DB; font-size: 16px; font-weight: bold; margin: 0; padding: 0; text-decoration: underline; } .u298d74f715492250fc62b5f3e630c999 .postTitle { color: #27AE60; font-size: 16px; font-weight: 600; margin: 0; padding: 0; width: 100%; } .u298d74f715492250fc62b5f3e630c999 .ctaButton { background-color: #e6e6e6!important; color: #3498DB; border: none; border-radius: 3px; box-shadow: none; font-size: 14px; font-weight: bold; line-height: 26px; moz-border-radius: 3px; text-align: center; text-decoration: none; text-shadow: none; width: 80px; min-height: 80px; background: url(https://www.poftut.com/wp-content/plugins/intelly-related-posts/assets/images/simple-arrow.png)no-repeat; position: absolute; right: 0; top: 0; } .u298d74f715492250fc62b5f3e630c999:hover .ctaButton { background-color: #E67E22!important; } .u298d74f715492250fc62b5f3e630c999 .centered-text { display: table; height: 80px; padding-left: 18px; top: 0; } .u298d74f715492250fc62b5f3e630c999 .u298d74f715492250fc62b5f3e630c999-content { display: table-cell; margin: 0; padding: 0; padding-right: 108px; position: relative; vertical-align: middle; width: 100%; } .u298d74f715492250fc62b5f3e630c999:after { content: ""; display: block; clear: both; } 了解更多Linux mv命令教程

翻译自: https://www.poftut.com/rename-multiple-files-linux/

linux中文件重命名

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。