这是我的源文件。
e2f9eb91-645f-408a-9241-66490b61a617_file-module-1.txt
d20f06a8-4de1-4da0-8175-93e9b2d81c42_file-module-2.txt
6740a19f-e1a0-43da-9a01-9e873238360e_file-module-3.txt
.
.
.
我需要找到一种方法来重命名所有文件,以删除 _file 之前的前 36 个字符或替换为其他内容。我期望所有文件如下。
_file-module-1.txt or Yong_file-module-1.txt
_file-module-2.txt or Yong_file-module-2.txt
_file-module-3.txt or Yong_file-module-3.txt
.
.
.
提前致谢!
您可以使用rename
像这样:
rename --dry-run 's/.*_file/Yong_file/' *.txt
如果您使用的是 macOS,则可以安装rename
with homebrew:
brew install rename
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)