shell的正则匹配IP
[root@master~]#cattest.txt 2014-08-17 20140907 140322 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原文链接:https://www.f2er.com/bash/389019.html