linux下查看公网ip

方法一:
curl http://iframe.ip138.com/ic.asp 2>/dev/null |grep '\[*\]' |cut -d "[" -f2 |cut -d "]" -f1

方法二:
w3m http://www.ip138.com/ip2city.asp
(没有w3m,请先安装,后执行)

方法三:
wget http://members.3322.org/dyndns/getip
cat getip

你可能感兴趣的:(linux,null)