免费注册 查看新帖 |

Chinaunix

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

grep -R / grep -w 分别什么意思啊? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-11-04 16:14 |只看该作者 |倒序浏览
-w, --word-regexp
              Select only those lines containing matches that form whole words.  The test is that the  matching  substring  must
              either  be  at  the beginning of the line, or preceded by a non-word constituent character.  Similarly, it must be
              either at the end of the line or followed by a non-word constituent character.   Word-constituent  characters  are
              letters, digits, and the underscore.



用谷歌翻译的一塌糊涂。

论坛徽章:
0
2 [报告]
发表于 2010-11-04 16:16 |只看该作者
  1. [oracle@s12071 ~]$ echo -e "hello\n hell"
  2. hello
  3. hell
  4. [oracle@s12071 ~]$ echo -e "hello\n hell" | grep -w "hell"
  5. hell
  6. [oracle@s12071 ~]$ echo -e "hello\n hell" | grep "hell"
  7. hello
  8. hell
  9. [oracle@s12071 ~]$
复制代码
w就是匹配整个单词而不是字符串

论坛徽章:
0
3 [报告]
发表于 2010-11-04 16:18 |只看该作者
谷歌翻译, 忒垃圾。

论坛徽章:
0
4 [报告]
发表于 2010-11-04 16:20 |只看该作者
回复 2# lkk2003rty


    哦,学习了!

论坛徽章:
0
5 [报告]
发表于 2010-11-04 18:56 |只看该作者
学习了

论坛徽章:
0
6 [报告]
发表于 2010-11-04 21:24 |只看该作者
每天积累一点,谢谢了

论坛徽章:
3
2015年迎新春徽章
日期:2015-03-04 09:56:11数据库技术版块每日发帖之星
日期:2016-08-03 06:20:00数据库技术版块每日发帖之星
日期:2016-08-04 06:20:00
7 [报告]
发表于 2010-11-04 21:31 |只看该作者
英语,很重要,还是学学吧,学夷长技以制夷,谁叫蛮夷现在的科技水平比我们高呢

论坛徽章:
0
8 [报告]
发表于 2010-11-05 10:06 |只看该作者
-R 递归查找

论坛徽章:
0
9 [报告]
发表于 2010-11-05 10:31 |只看该作者
linux下grep命令用法实例教程

例子比较多,如果在有关于grep的问题,基本上在上面都能找到
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP