linux - wget和curl各有何用处?(强大但是不知如何使用)
黄舟
黄舟 2017-04-17 15:41:47
[Linux讨论组]

描述问题

在我使用它们的有限时间里, 一直wget==文件下载器==curl, 但是见许多REST文档中都拿curl做例子,便man curl, 发现其简介如下:

curl  is  a tool to transfer data from or to a server, using one of the supported
       protocols (HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, DICT, TELNET, LDAP or  FILE).
       The command is designed to work without user interaction.

       curl  offers  a busload of useful tricks like proxy support, user authentication,
       FTP upload, HTTP post, SSL connections, cookies, file transfer resume  and  more.
       As you will see below, the number of features will make your head spin!

       curl  is powered by libcurl for all transfer-related features. See libcurl(3) for
       details.

英文浅显易懂, 我想: 功能这么强大, 估计又难免记忆一大堆参数(痛苦)

大家是如何用的?

上下文环境

  1. Linux纯命令行-Server

重现

相关代码

  1. man curl

  2. man wget

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

全部回复(2)
ringa_lee

个人行为:

  • wget一般用于下载文件

  • curl一般用于模拟请求,测试api

高洛峰

wget: 下载利器

  1. 下载速率慢的资源,浏览器经常会没下完就当完成了。建议加 -T5

  2. 批量下 HTML 文档:wget -T 5 -t 10 -Q 500m -nH -r -E -l inf -k -p -np URL

  3. 批量下 URL:wget -i URL列表文件

curl: 调试利器

  1. 简单好用,随处可得

  2. 浏览器的开发者工具支持复制为 curl 请求

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号