美文网首页
截取本机IP地址

截取本机IP地址

作者: 橡皮24 | 来源:发表于2018-10-09 13:25 被阅读17次
/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