Linux shell 获取本机公网地址

curl -s www.ip138.com/ip2city.asp | iconv  -f gbk -t utf8|grep -Po '(?<=\[).*?(?=\])'
curl -x 127.0.0.1:8087 -s www.ip138.com/ip2city.asp | iconv -f gbk -t utf8|grep -Po '(?<=\[).*?(?=\])'


 

posted on 2011-11-12 19:57  yangyh  阅读(762)  评论(0)    收藏  举报