小编til*_*row的帖子

为什么 egrep [wW][oO][rR][dD] 比 grep -i word 快?

我使用grep -i得更频繁,我发现它比egrep等效的慢,我匹配每个字母的大写或小写:

$ time grep -iq "thats" testfile

real    0m0.041s
user    0m0.038s
sys     0m0.003s
$ time egrep -q "[tT][hH][aA][tT][sS]" testfile

real    0m0.010s
user    0m0.003s
sys     0m0.006s
Run Code Online (Sandbox Code Playgroud)

是否grep -i做额外的测试,egrep不?

performance grep

49
推荐指数
2
解决办法
4916
查看次数

标签 统计

grep ×1

performance ×1