天天看點

擷取網卡IP位址指令

centos 7

ifconfig ens32|grep "inet"|awk -F ' ' 'NR==1{print $2}'

centos6

 ifconfig eth0|awk -F '[: ]+' 'NR==2{print $4 }'  

本文轉自  一招拜師  51CTO部落格,原文連結:http://blog.51cto.com/sadoc/1921705

繼續閱讀