免费注册 查看新帖 |

Chinaunix

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

find /-name core -exec rm{} [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-06-26 15:19 |只看该作者 |倒序浏览
请问查找并删除CORE文件的完整命令是不是这样的?如果是,后面的一堆大括号什么意思?find /-name core -print | rm可以吗?

论坛徽章:
0
2 [报告]
发表于 2004-06-26 18:46 |只看该作者

find /-name core -exec rm{}

  1. find ./ -name core -exec rm '{}' \;
复制代码

论坛徽章:
0
3 [报告]
发表于 2004-06-26 20:08 |只看该作者

find /-name core -exec rm{}

分号和大括号什么意思?

论坛徽章:
0
4 [报告]
发表于 2004-06-26 20:47 |只看该作者

find /-name core -exec rm{}

man find      

  1. -exec command ;
  2.               Execute  command;  true  if 0 status is returned.  All following
  3.               arguments to find are taken to be arguments to the command until
  4.               an  argument  consisting of `;' is encountered.  The string `{}'
  5.               is replaced by the current file name being processed  everywhere
  6.               it occurs in the arguments to the command, not just in arguments
  7.               where it is alone, as in some versions of find.  Both  of  these
  8.               constructions might need to be escaped (with a `\') or quoted to
  9.               protect them from expansion by the shell.  The command  is  exe-
  10.               cuted in the starting directory.
复制代码

论坛徽章:
0
5 [报告]
发表于 2004-06-26 21:53 |只看该作者

find /-name core -exec rm{}

非常感谢!

论坛徽章:
0
6 [报告]
发表于 2004-06-27 04:39 |只看该作者

find /-name core -exec rm{}

不自己先读手册到这里来叽里呱啦的...
花上10年也学不好。

论坛徽章:
0
7 [报告]
发表于 2004-06-27 13:04 |只看该作者

find /-name core -exec rm{}

不用分号也可以
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP