时间:2021-09-07 09:11:19 | 栏目:Shell | 点击:次
方法一:
or
/sbin/ifconfig|sed -n '/inet addr/s/^[^:]*:\([0-9.]\{7,15\}\) .*/\1/p'
方法二:
local_ip=`host $local_host 2>/dev/null | awk '{print $NF}'`
方法三:
nslookup -sil $local_host 2>/dev/null | grep Address: | sed '1d' | sed 's/Address://g'