linux 取出本机IP

取出本机IP地址:
ifconfig|grep Bcast|awk -F: '{print $2}'|awk -F " " '{print $1}'
ifconfig eth0|grep Bcast|awk -F: '{print $2}'|awk -F " " '{print $1}'
 
取出本机IP地址个数:
ifconfig|grep Bcast|awk -F: '{print $2}'|awk -F " " '{print $1}'|wc -l

你可能感兴趣的:(linux,linux,职场,休闲,取出本机IP)