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

标签: 一键, shell, 公网, IP地址, 查询

添加新评论