将ACDC更换为AC-DC
例如,我们有这些文件
ACDC – Rock N’ Roll Ain’t Noise Pollution.xxx
ACDC – Rocker.xxx
ACDC – Shoot To Thrill.xxx
我希望他们成为:
AC-DC – Rock N’ Roll Ain’t Noise Pollution.xxx
AC-DC – Rocker.xxx
AC-DC – Shoot To Thrill.xxx
我知道sed或awk用于此操作.我不能谷歌任何东西,所以我要求你的帮助=)你能为这项任务提供完整的shell命令吗?
rename 's/ACDC/AC-DC/' *.xxx
从男人重命名
DESCRIPTION "rename" renames the filenames supplied according to the rule specified as the first argument. The perlexpr argument is a Perl expression which is expected to modify the $_ string in Perl for at least some of the filenames specified. If a given filename is not modified by the expression,it will not be renamed. If no filenames are given on the command line,filenames will be read via standard input.
例如,要重命名匹配“* .bak”的所有文件以剥离扩展名,您可能会说
rename 's/\.bak$//' *.bak
要将大写名称翻译为较低的名称,您可以使用
rename 'y/A-Z/a-z/' *
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。