大家都清楚,windows下,可以在百度里面直接查到外网的IP地址信息,但是Linux命令行下如何操作了。
在命令行下做了下测试,结果如下:
1
2
3
4
5
6
7
8
9
|
root@DY1100S01:[
/home/zhang3
]curl
ifconfig
.sh
183.129.141.155
root@DY1100S01:[
/home/zhang3
]curl http:
//iframe
.ip138.com
/ic
.asp
<
head
><title>Object moved<
/title
><
/head
>
<body><h1>Object Moved<
/h1
>This object may be found <a HREF=
"http://www.skyname.cn/"
>here<
/a
>.<
/body
>
root@DY1100S01:[
/home/zhang3
]curl
ifconfig
.me
^C
root@DY1100S01:[
/home/zhang3
]curl icanhazip.com
183.129.141.155
|
测试发现:使用curl ifconfig.sh或者curl icanhazip.com可以很快的查到外网IP地址信息。
本文转自 冰冻vs西瓜 51CTO博客,原文链接:http://blog.51cto.com/molewan/1703083,如需转载请自行联系原作者