regex scratchpad

From thelinuxwiki
Revision as of 21:09, 3 May 2014 by Nighthawk (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

grep for pattern of startof line, numbers, spaces, word Any

# cat firewall_policy.txt | grep -E "^[0-9]* *Any" 

print firewall text rules between #..spaces...Any and the end of rule ----------\

# cat firewall_policy.txt | sed -n -e '/^[0-9]* *Any/,/--------------------/ p'