ip addr|sed -n '9p'|egrep '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'|sed -nr 's#^.*inet (.*) brd(.*)$#\1#gp'|sed -rn 's#^(.*)/24#\1#gp'|sed -rn 's#(.*)\.(.*)\.(.*)\.(.*)#\4#gp'
如下: