标签:bash toolbar master shell gre tool pre nbsp too
shell的正则匹配IP[root@master ~]# cat test.txt 2014-08-17 20140907 14 03 22 aa.aa.bb.cc af.23.67.90 ffffff oo.09.0f.87.90 192.168.1.2 121.168.2.3 0987238349 999.999.99.999 123-212-2-3
用grep
[root@master ~]# egrep "((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" test.txt 192.168.1.2 121.168.2.3
标签:bash toolbar master shell gre tool pre nbsp too
原文地址:http://blog.51cto.com/853056088/2060330