1. 常用命令选项
-f 连接失败时不显示http错误
-s 静音模式.不输出任何东西
-I 显示 Header 信息, 但是不能和 -F (上传文件) 一起使用
-S 显示错误
-L 当页面有跳转的时候, 输出跳转到的页面
-d POST方式传送数据
-A user-agent
-H header key:value
-X method
-k 不效验 https 证书
-c cookie.txt 将 cookie 保存到 cookie.txt
-b cookie.txt 使用 cookie.txt 的内容做为 cookie
-o 指定输出路径, - 表示输出到控制台
2. 获取IP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| # curl ipinfo.io { "ip": "114.110.1.38", "hostname": "No Hostname", "city": "Beijing", "region": "Beijing Shi", "country": "CN", "loc": "39.9289, 116.3883", "org": "AS4808 CNCGROUP IP network China169 Beijing Province Network" }
# curl ip.cn 当前 IP: 114.110.1.38 来自: 北京市 广东恒敦通信技术北京分公司
# curl cip.cc IP : 114.110.1.38 地址 : 中国 北京市 数据二 : 北京市 | 广东恒敦通信技术北京分公司 URL : http://www.cip.cc/114.110.1.38
# curl myip.ipip.net 当前 IP: 114.110.1.38 来自于: 中国 北京 北京 联通/电信
# curl ifconfig.me 114.110.1.38
# curl http://members.3322.org/dyndns/getip 114.110.1.38
|
3. 样例
1
| curl -x socks5://127.0.0.1:1080 http://www.baidu.com
|
4. Resource