Curl 纯文本格式输出:
curl icanhazip.com
curl ifconfig.me
curl curlmyip.com
curl ip.appspot.com
curl ipinfo.io/ip
curl ipecho.net/plain
curl www.trackip.net/i

curl JSON格式输出:
curl ipinfo.io/json
curl ifconfig.me/all.json
curl www.trackip.net/ip?json (有点丑陋)

curl XML格式输出:
curl ifconfig.me/all.xml

curl 得到所有IP细节 (挖掘机)
curl ifconfig.me/all

使用 DYDNS (当你使用 DYDNS 服务时有用)
curl -s 'http://checkip.dyndns.org' | sed 's/.*Current IP Address: \([0-9\.]*\).*/\1/g'
curl -s http://checkip.dyndns.org/ | grep -o "[[:digit:].]\+"

使用 Wget 代替 Curl
wget http://ipecho.net/plain -O - -q ; echo
wget http://observebox.com/ip -O - -q ; echo

使用 host 和 dig 命令
如果有的话,你也可以直接使用 host 和 dig 命令。

host -t a dartsclink.com | sed 's/.*has address //'
dig +short myip.opendns.com @resolver1.opendns.com

bash 脚本示例:
#!/bin/bash
PUBLIC_IP=`wget http://ipecho.net/plain -O - -q ; echo`
echo $PUBLIC_IP

最新文章

  1. 裁剪要素出现错误 :HRESULT:0x80040239
  2. RCP:gef智能寻路算法(A star)
  3. CSS 概念 Block Inline Containing block
  4. iOS支付宝集成时遇到的问题整理(1)
  5. linux下proc里关于磁盘性能的参数
  6. touch ImageView
  7. 什么是AJAX技术及其常识
  8. Mysql-udf-http 插件的安装与使用
  9. Java使用POI解析Excel表格
  10. MySQL:参数wait_timeout和interactive_timeout以及空闲超时的实现【转】
  11. 『数组的最大代价 贪心优化DP』
  12. 单元测试系列之八:Sonar 数据库表关系整理一(续)
  13. python接口自动化28-requests-html爬虫框架
  14. Mac下安装Mysql以及修改Mysql密码
  15. Android.StructureOfAndroidSourceCodeRootTree
  16. python traceback捕获并打印异常
  17. JS浏览器BOM
  18. LINUX下PHP编译添加相应的动态扩展模块so(不需要重新编译PHP,以openssl.so为例)
  19. 如何实现PLC与THINGWORX工业物联网平台对接
  20. React生命周期总结

热门文章

  1. 面经手册 · 第14篇《volatile 怎么实现的内存可见?没有 volatile 一定不可见吗?》
  2. echarts常用功能封装|抽象为mixin
  3. 微服务nacos服务注册与发现
  4. Oracl Linux KVM虚拟机备份
  5. altium designer使用小技巧,记录
  6. ctfshow 1024杯 部分web题解
  7. Google Cayley图数据库使用方法
  8. day78:luffy:前端对于token的认证&滑动验证码的实现
  9. 【转】Setting up SDL 2 on MinGW
  10. Java关键字——break和continue、this等