Grep: Difference between revisions

390 bytes added ,  6 years ago
→‎One-Liners: searching
m (Protected "Grep" ([Edit=Allow only logged in users] (indefinite) [Move=Allow only logged in users] (indefinite) [Delete=Allow only logged in users] (indefinite)))
(→‎One-Liners: searching)
Line 67:
|-
| Search for "virus" in all files in a dir || grep virus /etc/snort/rules/*
|-
| Search this or that using Extended Regex || <nowiki>grep -E '(then|there)' demo_text</nowiki>
|-
| Search this or that without Extended Regex || <nowiki>grep '\(then\|there\)' demo_text</nowiki>
|-
| Search this or that grouping not necessary || <nowiki>grep 'then\|there' demo_text</nowiki>
|-
| Search this or that grouping required || <nowiki>grep 'the\(n\|re\)' demo_text</nowiki>
|}
<br />