shell一键查询公网IP地址

Thursday, Feb 18, 2021 | 1 minute read | Updated at Thursday, Feb 18, 2021

@

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

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

也可以直接写成shell脚本

#!/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

© 2018 - 2026 vpslala

🌱 Powered by Hugo with theme Dream.