Grep: Difference between revisions

133 bytes added ,  6 years ago
Line 45:
|-
| Display N lines around match || grep -C 2 "Example" demo_text
|-
| Color Filtered Output || grep "Gecko" /data --color=always
|-
| Highlighting the search using GREP_OPTIONS || export GREP_OPTIONS='--color=auto' GREP_COLOR='100;8'
Line 77 ⟶ 79:
|-
| Search Email addresses using regex || <nowiki>grep -E -o "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" filename.txt</nowiki>
|-
| Grep from compressed files || zgrep -I "free space" ./messages*
|}
<br />