免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1509 | 回复: 8
打印 上一主题 下一主题

Rename all the files [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-09-05 20:40 |只看该作者 |倒序浏览
Hi guys,

If I am in the topmost directory and would need to rename all *.sql
files to *.pls files within all the subdirectories till the last level
then how would I achieve that ?

Thks

论坛徽章:
0
2 [报告]
发表于 2004-09-05 22:22 |只看该作者

Rename all the files

E文? 好深奥

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
3 [报告]
发表于 2004-09-06 07:13 |只看该作者

Rename all the files

have a look at:
http://bbs.chinaunix.net/forum/24/20040829/396712.html

hint: change the echo command to your renaming code.

论坛徽章:
0
4 [报告]
发表于 2004-09-06 08:22 |只看该作者

Rename all the files

[quote]原帖由 "bjgirl"]E文? 好深奥 [/quote 发表:

  
只是想炼一下偶的E文,
但是又想提问,
所以我把我想的用E文表达出来,
这样一来可以增强E文,
二来可以达到提问的效果,
何乐而不为?
BTW,偶的E文特差!   

论坛徽章:
0
5 [报告]
发表于 2004-09-06 08:34 |只看该作者

Rename all the files


  1. find / -type f -name "*.sql" | sed s/\(.*\)\.sql/mv & \1.pls/' | sh
复制代码

论坛徽章:
0
6 [报告]
发表于 2004-09-06 18:36 |只看该作者

Rename all the files

偷懒的做法:
find ./ -type f -name "*.sql" |xargs -n 1 -i mv "{}" "{}".pls

论坛徽章:
0
7 [报告]
发表于 2004-09-06 19:29 |只看该作者

Rename all the files

原帖由 "panlm" 发表:
偷懒的做法:
find ./ -type f -name "*.sql" |xargs -n 1 -i mv "{}" "{}".pls

佩服 ... 你的xargs运用的如此出神入化

论坛徽章:
0
8 [报告]
发表于 2004-09-06 21:04 |只看该作者

Rename all the files

原帖由 "bjgirl" 发表:

佩服 ... 你的xargs运用的如此出神入化


不敢, 今天刚领教了阁下的seq. 真是佩服得五体投地

论坛徽章:
0
9 [报告]
发表于 2004-09-06 21:12 |只看该作者

Rename all the files

是  *.sql ==> *.pls
不是*.sql ==> *.sql.pls ?????????

先求严谨,再求出神入化吧。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP