Regular Expressions
From Notes
View a log file without comments or blank lines, assuming comments begin with a # as the first character:
The big space between the square brackets is a single space followed by the characters Ctl-i -> Ctl-v to indicate a tab.
egrep -v '^#.*$|^[ ]*$' /etc/snmp/snmpd.conf
vim regexes
I used the following within vim to modify a hosts file to include FQDN when there were only the short names and IPs:
22,31s/\(192.168.0.\d\{3}\)\s\+\(\a\+\d\=\)/\1 \2.example.com \2/g
This could be optimized a bit, but I'm new to vim regexes.
