# 如匹配/etc/resolv.conf中的所有数字:
grep "[[:digit:]]" /etc/resolv.conf
# 需要注意的是,这里需要用额外的 [] 将字符合集括起来。
nameserver 192.168.18.210
nameserver 8.8.8.8
ip add list |egrep "^[[:space:]]+inet[^6].*[^lo]$"
inet 192.168.7.100/24 brd 192.168.7.255 scope global eth0
# 找出ifconfig不包含回环地址的其他IP地址,不包括IP广播地址和子网掩码等信息:
ifconfig |egrep --color "\<([1-9]|[1-9][0-9]|1[0-1]+[0-9]+|12[^7]+|1[3-9]+[0-9]|2[01][0-9]|22[0-3])\>(\.\<([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-4])\>){2}\.\<([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-4])\>"
inet addr:192.168.7.100 Bcast:192.168.7.255 Mask:255.255.255.0
# 多条件并列排除匹配
zcat mydb.bak.20140408_1.dump.gz |grep -v -E "^INSERT INTO \`(ci_channel|ci_cluster)\` "