Shell获取IP
跳到导航
跳到搜索
intra ip
[evan@prod-core-mongo ~]$ sudo ip a | grep eth0| awk '{print $2}' eth0: 172.16.0.40/20 [evan@prod-core-mongo ~]$ sudo ip a | grep eth0| awk '{print $2}'|sed -n '2p' 172.16.0.40/20 [evan@prod-core-mongo ~]$ sudo ip a | grep eth0| awk '{print $2}'|sed -n '2p'|awk -F'/' '{print $1}' 172.16.0.40