命令行获取主机外网IP,相当于ip138的功能

linux下:
[root@server]# curl -s 'http://checkip.dyndns.org' | sed 's/.*Current IP Address: \([0-9\.]*\).*/\1/g'
Windows上面运行:
前提是安装了curl和sed命令)
C:\Users\Administrator> curl -s " http://checkip.dyndns.org" | sed "s/.*Current IP Address: \([0-9\.]*\).*/\1/g"

你可能感兴趣的:(职场,curl,休闲,外网ip,ip138功能)