mac osx 获取内网ip的方法
(1) ping -c 1 $(hostname) | grep -m 1 -oP \'(\d+\.)+\d+\' # ping selfhost and catch the first matched ip
(2) host $(hostname) | grep -oP \'(\d+\.)+\d+\' # catch matched ip from selfhost\'s hostname and ip
(1) ping -c 1 $(hostname) | grep -m 1 -oP \'(\d+\.)+\d+\' # ping selfhost and catch the first matched ip
(2) host $(hostname) | grep -oP \'(\d+\.)+\d+\' # catch matched ip from selfhost\'s hostname and ip
相关文章: