Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's a nice idea, but I think maybe only to replace a simple egrep.

grep has tons of great option like

-F = fgrep; no regex - way faster

-v = as mentioned in the article

-o = print only matched input, not the entire line

-C = context, print lines before and after the match; can also be used partially with -A (after) and -B (before)



Small note: For GNU grep on single regexes at least, the -F flag should not impact performance. It is smart enough to see through a pattern as a literal and avoid the regex engine.


Thanks, I didn't know this.


Of course you might still want to use fgrep to make sure + and . match with the characters and are not interpreted like regular expression operators.


Also, super handy: grep colors the part of the line that matched.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: