linux一个取IP的方法

ifconfig eth0|sed -n '/inet.*/s/^[^:]*:\([0-9.]\{7,15\}\) .*/\1/p'

猜你喜欢

转载自alexzh.iteye.com/blog/1708920