重命名命令中的下划线(Perl和Unix shell) [英] Underscore in rename command (Perl and Unix shell)
本文介绍了重命名命令中的下划线(Perl和Unix shell)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正试图用所有文件名 -
连字符替换所有 _
下划线字符 .mat
在一个文件夹内。
我输入不同的版本不成功:
I'm trying to replace all _
underscore character by -
hyphen character in all file names .mat
inside one folder.
I type different versions unsuccessfully of:
rename -f 'w/_/-' *.mat
有人可以向我解释什么是错的?
Can someone explain to me what is wrong?
推荐答案
如果您使用基于Perl的重命名
(作为您的标签建议),然后 w
不是Perl正则表达式操作。
If you're using a Perl-based rename
(as your tags suggest) then w
isn't a Perl regex operation.
rename -f 's/_/-/g' *_*.mat
这篇关于重命名命令中的下划线(Perl和Unix shell)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文