admin avatar

shell一键查询公网IP地址

🕜 by admin

shell一键查询公网IP地址。命令如下

curl -s http://myip.ipip.net

也可以直接写成shell脚本

Bash:
1
2
3
4
#!/bin/bash

ip=$(curl -s http://myip.ipip.net)
echo "My public IP address is: $ip"

下面是常有的IP公网地址查询地址。

curl http://icanhazip.com

curl http://ifconfig.me

curl http://curlmyip.com

curl http://ip.appspot.com

curl http://ipinfo.io/ip

curl http://ipecho.net/plain

curl http://www.trackip.net/i

💘 相关文章

写一条评论