标签:
实例一:
a.log文件内容如下:
grep -E ‘WARNING|FATAL‘ a.log | grep -v ‘IGNOR‘
结果输出:
ccccccc FATAL ddddbbbb
aaa bbb ddd adfd:WARNING ffff eeee
实例二:
a.log文件内容如下:
[root@host-172-168-80-54 home]# cat a.log
aaaaaaaaaaaa
abbbb WARNING oooo IGNOR
ccccccc FATAL ddddbbbb
duuuuuuuuu IGNOR pppppppp
aaa bbb ddd adfd:WARNING ffff eeee
grep -E ‘WARNING|FATAL‘ a.log | grep -v ‘IGNOR‘ | awk -F : ‘{print $2 }‘
结果输出:WARNING ffff eeee
标签:
原文地址:http://www.cnblogs.com/yinjia/p/5463680.html