LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 752|回复: 8

求 搜索文件名包含realplay的文件并删除的脚本!

[复制链接]
发表于 2004-8-30 15:10:44 | 显示全部楼层 |阅读模式
谢谢!
发表于 2004-8-30 15:13:09 | 显示全部楼层
用find吧
  1. find / -name "*realplay*" -exec rm {} \;
复制代码

ps:
执行之前,最好用ls来替代rm,以防外一
 楼主| 发表于 2004-8-30 15:15:19 | 显示全部楼层
不理解rm 后的{} \
望指教!
发表于 2004-8-30 15:17:10 | 显示全部楼层
{} \;
这是find执行command的格式!
{}包含了find出的结果
更多的关于find的用法,见:
http://www.linuxsir.cn/bbs/showthread.php?threadid=41548
或者看看他的manpage
 楼主| 发表于 2004-8-30 15:19:22 | 显示全部楼层
find / -name "*realplay*" -exec ls {}\
> ;
find: missing argument to `-exec'
发表于 2004-8-30 15:20:46 | 显示全部楼层
{}和\之间要有空格!
 楼主| 发表于 2004-8-30 15:21:50 | 显示全部楼层
find / -name "*realplay*" -exec ls {} \
> ;
find: missing argument to `-exec'
发表于 2004-8-30 15:26:54 | 显示全部楼层
注意格式!!!
find ... -exec ls {} \;
 楼主| 发表于 2004-8-30 15:31:19 | 显示全部楼层
DONE!
btw:你是我碰到的最热心的第二人!
哈哈!
谢谢!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表