首页 > 其他 > 详细

rename命令

时间:2018-05-15 16:38:06      阅读:124      评论:0      收藏:0      [点我收藏+]
rename:Rename files 用字符串替换的方式批量改变文件名

参数:

            源字符串   目标字符串   文件列表

实例1:

[root@www ~]# rename wget.txt wget.log wget.txt

[root@www ~]# ll wget.log

-rw-r--r-- 1 root root 80553 4月  14 03:32 wget.log

 实例2:

[root@www ~]# ll *.txt

-rw-r--r--  1 root root 94077 4月  14 03:53 passwd.txt

-rw-r--r--  1 root root 65289 4月  14 05:43 tcpdump.txt

-rw-r--r--. 1 root root   427 11月 26 06:24 users.txt

[root@www ~]# rename .txt .log *

[root@www ~]# ll *.txt

ls: 无法访问*.txt: 没有那个文件或目录

[root@www ~]# ll *.log

-rw-r--r--  1 root root  94077 4月  14 03:53 passwd.log

-rw-r--r--  1 root root  65289 4月  14 05:43 tcpdump.log

-rw-r--r--. 1 root root    427 11月 26 06:24 users.log

-rw-r--r--  1 root root  80553 4月  14 03:32 wget.log


rename命令

原文:http://blog.51cto.com/12107790/2116393

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!