/sbin/ifconfig -a eno16777736 |grep inet|grep -v inet6|awk '{print $2}'|tr -d "addr:"
执行结果
[root@cxm ~]#/sbin/ifconfig -a eno16777736 |grep inet|grep -v inet6|awk '{print $2}'|tr -d "addr:"
192.168.1.200
注意:eno16777736为你的网卡名称
/sbin/ifconfig -a eno16777736 |grep inet|grep -v inet6|awk '{print $2}'|tr -d "addr:"
执行结果
[root@cxm ~]#/sbin/ifconfig -a eno16777736 |grep inet|grep -v inet6|awk '{print $2}'|tr -d "addr:"
192.168.1.200
注意:eno16777736为你的网卡名称
本文标题:截取本机IP地址
本文链接:https://www.haomeiwen.com/subject/nqveaftx.html
网友评论