如何在Linux / Unix中将多个文件从一个扩展名重命名为另一个扩展名?
发布时间:2021-02-21 05:43:11  所属栏目:Linux  来源:互联网 
            导读:我有一些以’.1’结尾的文件,例如: example.file.ex1.1example.file.ex2.1example.file.ex3.1 有没有办法可以快速重命名它们而不使用末尾的’.1′(例如example.file.ex1,example.file.ex2等)? 谢谢! 纯粹的bash解决方案: for curFile in example.file.*.1
                
                
                
            | 
                         我有一些以’.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                        (编辑:莱芜站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!  | 
                  
相关内容
- linux – 了解/ boot / config文件
 - TwitteR r包:/usr/lib/x86_64-linux-gnu/libcurl.so.4:找
 - cenos7.3启动apache,cenos7.3启动mysql
 - 从Linux上载10,000,000个文件到Azure blob存储
 - 跨线休息的tmux拷贝线
 - linux内核 – 从linux内核模块访问串行端口
 - linux – RHEL7 – /usr/lib64 / libstdc .so.6:版本“CXX
 - lvm – 逻辑卷属性
 - 如何告诉SELinux在没有audit2allow的情况下允许nginx访问un
 - 在同一个Linux目录中有几百个或几千个文件可以(性能方面)吗
 
