grep,egrep和fgrep的区别
来源:互联网 发布:mac虚拟机哪个好 编辑:程序博客网 时间:2024/04/29 11:03
转自:http://blog.sina.com.cn/s/blog_51dc0fba0100lqu8.html
* grep:
传统的 grep 程序, 在没有参数的情况下, 只输出符合 RE 字符串之句子. 常见参数如下:
-v: 逆反模示, 只输出"不含" RE 字符串之句子.
-r: 递归模式, 可同时处理所有层级子目录里的文件.
-q: 静默模式, 不输出任何结果(stderr 除外. 常用以获取 return value, 符合为 true, 否则为 false .)
-i: 忽略大小写.
-w: 整词比对, 类似 \<word\> .
-n: 同时输出行号.
-c: 只输出符合比对的行数.
-l: 只输出符合比对的文件名称.
-o: 只输出符合 RE 的字符串. (gnu 新版独有, 不见得所有版本都支持.)
-E: 切换为 egrep .
* egrep:
为 grep 的扩充版本, 改良了许多传统 grep 不能或不便的操作. 比方说:
- grep 之下不支持 ? 与 + 这两种 modifier, 但 egrep 则可.
- grep 不支持 a|b 或 (abc|xyz) 这类"或一"比对, 但 egrep 则可.
- grep 在处理 {n,m} 时, 需用 \{ 与 \} 处理, 但 egrep 则不需.
诸如此类的... 我个人会建议能用 egrep 就不用 grep 啦... ^_^
* fgrep:
不作 RE 处理, 表达式仅作一般字符串处理, 所有 meta 均失去功能.
男人知道:
0 0
- grep,egrep和fgrep的区别
- grep,egrep和fgrep的区别
- grep,egrep和fgrep的区别
- grep,egrep和fgrep的区别
- grep、fgrep、egrep区别
- linux里grep和egrep,fgrep的区别
- linux里grep和egrep,fgrep的区别
- grep 和 egrep fgrep
- grep、fgrep 和 egrep 命令
- grep, egrep, fgrep的man帮助手册
- grep , egrep ,fgrep
- grep、egrep、fgrep命令
- grep,fgrep,egrep
- grep、egrep、fgrep命令
- grep、egrep、fgrep命令
- grep、egrep、fgrep
- 6. redhat grep、egrep、fgrep
- shell编程grep/egrep/fgrep
- 隐马尔可夫模型攻略
- LeetCode OJ 之 Kth Largest Element in an Array(数组中的第k大元素)
- [applicationContext.xml] cannot be opened because it does not exist错误
- Auto Fix TextView
- Linux系统编程——进程调度浅析
- grep,egrep和fgrep的区别
- javascript中的ajax对象(一)
- 重写TextView给文字描边
- 分布式文件系统FastDFS原理介绍
- linux shell 导出mongodb 数据库 & 导出 mysql数据库
- Memcached常用命令及使用说明
- windows使用glog
- 关于ASP.NET控件和HTML控件的区别
- Qt使用ActiveX控件