# IPv4: # 5类:A B C D E # A:1-127 # B:128-191 # C:192-223 ifconfig | egrep '\<([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\>\.\ <([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\>\.\<([0-9]|[1-9][0-9] |1[0-9][0-9]|2[0-4][0-9]|25[0-5])\>\.\<([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4 ][0-9]|25[0-5])\>' # 使用的时候注意要把换行去掉
转载于:https://blog.51cto.com/12085228/1982302