免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 6380 | 回复: 6
打印 上一主题 下一主题

[网络相关] 为什么我用curl 和wget 下载到的不同呢? [复制链接]

论坛徽章:
13
CU大牛徽章
日期:2013-03-14 14:14:082016科比退役纪念章
日期:2016-07-22 11:15:35数据库技术版块每日发帖之星
日期:2016-05-27 06:20:002015亚冠之吉达阿赫利
日期:2015-08-05 10:06:542015年亚洲杯之韩国
日期:2015-04-01 16:05:42双鱼座
日期:2014-11-13 11:04:24丑牛
日期:2014-07-25 17:29:54子鼠
日期:2014-04-25 12:25:45丑牛
日期:2014-04-17 08:35:48巨蟹座
日期:2014-04-16 16:50:05CU大牛徽章
日期:2013-03-14 14:14:29CU大牛徽章
日期:2013-03-14 14:14:26
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2014-06-17 10:19 |只看该作者 |倒序浏览
本帖最后由 hmchzb19 于 2014-06-17 11:08 编辑

我用curl -O
和wget 分别下载
https://github.com/twbs/bootstra ... trap-3.0.3-dist.zip

,发先wget 得到了这个zip 文件,而curl -O 只得到了这个网页。

好奇怪,谁能解释下?

论坛徽章:
0
2 [报告]
发表于 2014-06-17 10:28 |只看该作者
@hmchzb19
这两个命令,我都没有得到。
  1. [root@GO-EMAIL-1 aa]# curl -o "https://github.com/twbs/bootstrap/releases/download/v3.0.3/bootstrap-3.0.3-dist.zip"
  2. curl: no URL specified!
  3. curl: try 'curl --help' for more information
  4. [root@GO-EMAIL-1 aa]# wget "https://github.com/twbs/bootstrap/releases/download/v3.0.3/bootstrap-3.0.3-dist.zip"
  5. --2014-06-17 10:29:39--  https://github.com/twbs/bootstrap/releases/download/v3.0.3/bootstrap-3.0.3-dist.zip
  6. Resolving github.com... 192.30.252.130
  7. Connecting to github.com|192.30.252.130|:443... connected.
  8. ERROR: cannot verify github.com's certificate, issued by `/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 Extended Validation Server CA':
  9.   Unable to locally verify the issuer's authority.
  10. To connect to github.com insecurely, use `--no-check-certificate'.
  11. Unable to establish SSL connection.
复制代码

论坛徽章:
13
CU大牛徽章
日期:2013-03-14 14:14:082016科比退役纪念章
日期:2016-07-22 11:15:35数据库技术版块每日发帖之星
日期:2016-05-27 06:20:002015亚冠之吉达阿赫利
日期:2015-08-05 10:06:542015年亚洲杯之韩国
日期:2015-04-01 16:05:42双鱼座
日期:2014-11-13 11:04:24丑牛
日期:2014-07-25 17:29:54子鼠
日期:2014-04-25 12:25:45丑牛
日期:2014-04-17 08:35:48巨蟹座
日期:2014-04-16 16:50:05CU大牛徽章
日期:2013-03-14 14:14:29CU大牛徽章
日期:2013-03-14 14:14:26
3 [报告]
发表于 2014-06-17 11:11 |只看该作者
curl 是大O,我改过了

论坛徽章:
33
荣誉会员
日期:2011-11-23 16:44:17天秤座
日期:2014-08-26 16:18:20天秤座
日期:2014-08-29 10:12:18丑牛
日期:2014-08-29 16:06:45丑牛
日期:2014-09-03 10:28:58射手座
日期:2014-09-03 16:01:17寅虎
日期:2014-09-11 14:24:21天蝎座
日期:2014-09-17 08:33:55IT运维版块每日发帖之星
日期:2016-04-17 06:23:27操作系统版块每日发帖之星
日期:2016-04-18 06:20:00IT运维版块每日发帖之星
日期:2016-04-24 06:20:0015-16赛季CBA联赛之天津
日期:2016-05-06 12:46:59
4 [报告]
发表于 2014-06-17 11:12 |只看该作者
curl 好象不会 302 的. wget 可以.

论坛徽章:
0
5 [报告]
发表于 2014-06-17 11:54 |只看该作者
@hmchzb19

curl -O我这里同样什么也没有。
  1. [root@GO-EMAIL-1 aa]# curl -O "https://github.com/twbs/bootstrap/releases/download/v3.0.3/bootstrap-3.0.3-dist.zip"

  2. curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
  3. error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
  4. More details here: http://curl.haxx.se/docs/sslcerts.html

  5. curl performs SSL certificate verification by default, using a "bundle"
  6. of Certificate Authority (CA) public keys (CA certs). The default
  7. bundle is named curl-ca-bundle.crt; you can specify an alternate file
  8. using the --cacert option.
  9. If this HTTPS server uses a certificate signed by a CA represented in
  10. the bundle, the certificate verification probably failed due to a
  11. problem with the certificate (it might be expired, or the name might
  12. not match the domain name in the URL).
  13. If you'd like to turn off curl's verification of the certificate, use
  14. the -k (or --insecure) option.
复制代码

论坛徽章:
13
CU大牛徽章
日期:2013-03-14 14:14:082016科比退役纪念章
日期:2016-07-22 11:15:35数据库技术版块每日发帖之星
日期:2016-05-27 06:20:002015亚冠之吉达阿赫利
日期:2015-08-05 10:06:542015年亚洲杯之韩国
日期:2015-04-01 16:05:42双鱼座
日期:2014-11-13 11:04:24丑牛
日期:2014-07-25 17:29:54子鼠
日期:2014-04-25 12:25:45丑牛
日期:2014-04-17 08:35:48巨蟹座
日期:2014-04-16 16:50:05CU大牛徽章
日期:2013-03-14 14:14:29CU大牛徽章
日期:2013-03-14 14:14:26
6 [报告]
发表于 2014-06-18 15:26 |只看该作者
搞定了

确实如此,curl 默认不会处理302的重定向,
不过有-L 参数就可以了。


论坛徽章:
33
荣誉会员
日期:2011-11-23 16:44:17天秤座
日期:2014-08-26 16:18:20天秤座
日期:2014-08-29 10:12:18丑牛
日期:2014-08-29 16:06:45丑牛
日期:2014-09-03 10:28:58射手座
日期:2014-09-03 16:01:17寅虎
日期:2014-09-11 14:24:21天蝎座
日期:2014-09-17 08:33:55IT运维版块每日发帖之星
日期:2016-04-17 06:23:27操作系统版块每日发帖之星
日期:2016-04-18 06:20:00IT运维版块每日发帖之星
日期:2016-04-24 06:20:0015-16赛季CBA联赛之天津
日期:2016-05-06 12:46:59
7 [报告]
发表于 2014-06-18 15:29 |只看该作者
回复 6# hmchzb19




谢谢, 我也学了一招.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP