Linux rename命令批量修改文件名

版权声明: https://blog.csdn.net/Liuboxx1/article/details/84336972

一般都是用mv,但是mv只能修改一个文件名,批量修改的话还得写脚本来实现
rename命令就可以了,可以使用通配符

[root@iZ251q18ty4Z test]# touch a.test.com b.test.com c.test.com
[root@iZ251q18ty4Z test]# ls
a.test.com  b.test.com  c.test.com
[root@iZ251q18ty4Z test]# rename test tt a.test.com 
[root@iZ251q18ty4Z test]# ls
a.tt.com  b.test.com  c.test.com
[root@iZ251q18ty4Z test]# rename test tt *test*
[root@iZ251q18ty4Z test]# ls
a.tt.com  b.tt.com  c.tt.com

猜你喜欢

转载自blog.csdn.net/Liuboxx1/article/details/84336972