analyze text with grep
grep, “general regular expression parser”.
Most useful grep
commands
Option | Use |
---|---|
-i |
No case sensitivity, matches upper and lower case. |
-v |
Only shows lines that DO NOT contain the regular expression. |
-r |
Search files in the current directory and all subdirectories. |
-e |
Search for line matching more than one regular expression. |
-A 2 |
Show 2 lines after the matching regular expression. |
-B 2 |
Show 2 lines before the matching regular expression. |