Linux 下获取机器 IP 的方法

ip -4 route get 8.8.8.8 | awk {'print $7'} | tr -d '\n'

评论