如何在Linux / Unix中将多个文件从一个扩展名重命名为另一个扩展
发布时间:2020-12-13 19:41:45 所属栏目:Linux 来源:网络整理
导读:我有一些以’.1’结尾的文件,例如: example.file.ex1.1example.file.ex2.1example.file.ex3.1 有没有办法可以快速重命名它们而不使用末尾的’.1′(例如example.file.ex1,example.file.ex2等)? 谢谢! 解决方法 纯粹的bash解决方案: for curFile in exampl
我有一些以’.1’结尾的文件,例如:
example.file.ex1.1 example.file.ex2.1 example.file.ex3.1 有没有办法可以快速重命名它们而不使用末尾的’.1′(例如example.file.ex1,example.file.ex2等)? 谢谢! 解决方法
纯粹的bash解决方案:
for curFile in example.file.*.1; do mv -- "$curFile" "${curFile:0:-2}" done (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |