Linux上面运行:
[root@pla-bjds-bw-220-180 ~]# curl -s 'http://checkip.dyndns.org' | sed 's/.*Current IP Address: \([0-9\.]*\).*/\1/g'
121.101.220.180Windows上面运行:(前提是安装了curl和sed命令)
C:\Documents and Settings\longkaty>curl -s "http://checkip.dyndns.org" | sed "s/.*Current IP Address: \([0-9\.]*\).*/\1/g"
119.32.193.251注:linux和windows命令行执行命令主要区别是linux下面命令行中的单引号一定要转换为双引号!