免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12
最近访问板块 发新帖
楼主: zhengwei_zw
打印 上一主题 下一主题

find . -name "*.htm"|xargs -i grep -l "ffmail" {}|more [复制链接]

论坛徽章:
0
11 [报告]
发表于 2007-03-16 14:59 |只看该作者
手头没有FreeBSD...我也是看man帮你...你先看find的结果...
我那个不要用J用I试试...手头都是linux

论坛徽章:
0
12 [报告]
发表于 2007-03-16 15:00 |只看该作者
ns# find /home/user -name "*.php" | xargs -I % grep -l http://%7 %
正在find……

论坛徽章:
0
13 [报告]
发表于 2007-03-16 15:00 |只看该作者
原帖由 zhengwei_zw 于 2007-3-16 14:58 发表

xargs -I %  grep -l http://%7 %
这两个%是配对 的?



使用%作为替换字符串...
你试试...手头没有环境, 很难测试

论坛徽章:
0
14 [报告]
发表于 2007-03-16 15:01 |只看该作者
应该可以,我找了个函数,一下就查到文件了。谢谢

论坛徽章:
0
15 [报告]
发表于 2007-03-16 15:01 |只看该作者
  1. -I {}
复制代码

加个空格试试

论坛徽章:
0
16 [报告]
发表于 2007-03-16 15:21 |只看该作者
xargs: unterminated quote
好象确实有问题

论坛徽章:
0
17 [报告]
发表于 2007-03-16 15:27 |只看该作者
原帖由 zhengwei_zw 于 2007-3-16 15:21 发表
xargs: unterminated quote
好象确实有问题



你可以先find然后生成一个文件. 然后一段一段的去  xargs

或者看看, 也许有帮助

-L number
             Call utility for every number lines read.        If EOF is reached and
             fewer lines have been read than number then utility will be
             called with the available lines.

-n number
             Set the maximum number of arguments taken from standard input for
             each invocation of utility.  An invocation of utility will use
             less than number standard input arguments if the number of bytes
             accumulated (see the -s option) exceeds the specified size or
             there are fewer than number arguments remaining for the last
             invocation of utility.  The current default value for number is
             5000.

论坛徽章:
0
18 [报告]
发表于 2007-03-16 23:01 |只看该作者
find . -name "*.htm" -exec grep -l "ffmail" {} \;
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP