Network - curl和Wget
curl - transfer a URL
SYNOPSIS
curl [options] [URL...]
DESCRIPTION
curl is a tool to transfer data from or to a server, using one of the supported protocols (DICT, FILE, FTP, FTPS, GOPHER, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP,SCP, SFTP, SMTP, SMTPS, TELNET and TFTP).
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, Metalink, and more.
curl is powered by libcurl for all transfer-related features. See libcurl(3) for details.
Wget - The non-interactive network downloader.
SYNOPSIS
wget [option]... [URL]...
DESCRIPTION
GNU Wget is a free utility for non-interactive download of files from the Web.
It supports HTTP, HTTPS, and FTP protocols, as well as retrieval through HTTP proxies.
Wget is non-interactive, meaning that it can work in the background, while the user is not logged on.
This allows you to start a retrieval and disconnect from the system, letting Wget finish the work.
By contrast, most of the Web browsers require constant user's presence, which can be a great hindrance when transferring a lot of data.
Wget can follow links in HTML, XHTML, and CSS pages, to create local versions of remote web sites, fully recreating the directory structure of the original site.
This is sometimes referred to as "recursive downloading." While doing that, Wget respects the Robot Exclusion Standard (/robots.txt).
Wget can be instructed to convert the links in downloaded files to point at the local files, for offline viewing.
Wget has been designed for robustness over slow or unstable network connections; if a download fails due to a network problem, it will keep retrying until the whole file has been retrieved.
If the server supports regetting, it will instruct the server to continue the download from where it left off.
区别
| curl | wget | |
|---|---|---|
| 简述 | 主要作为调试工具 | 主要作为下载工具 |
| 特点 | 由libcurl库支持,可模拟web请求,测试API,支持协议众多,支持下载 | 命令行命令,使用简洁,支持递归和断点 |
| 缺点 | 拼接复杂请求麻烦;下载需要额外参数 | 不支持并发、p2p、磁力链接等 |
代理设置
临时方式
使用命令时指定代理
curl -x "http://10.144.1.10:8080" www.baidu.com
wget -c "http_proxy=10.144.1.10:8080" http://mirrors.sohu.com/python/2.7.12/Python-2.7.12.tgz更改当前终端的环境变量
一般的linux程序都是使用http_proxy和ftp_proxy这两个环境变量来获得代理设置的。
声明环境变量export http_proxy=proxy_addr:port就可以在这个shell界面直接使用命令了。
例如:export http_proxy=10.144.1.10:8080
永久方式
在配置文件/etc/wgetrc中添加如下内容:
# You can set the default proxies for Wget to use for http and ftp.
# They will override the value in the environment.
http_proxy = http://10.144.1.10:8080/
https_proxy = http://10.144.1.10:8080/
#ftp_proxy = http://proxy.yoyodyne.com:18023/
# If you do not want to use proxy at all, set this to off.
use_proxy = yes
Network - curl和Wget的更多相关文章
- curl and wget
写在前面: a. 对比curl 和 wget 的相同和不同点 来记忆 a-1 curl url 直接将请求内容输出到标准输出. 如果下载不是瞬时间完成,会显示下载进度条,如果向取消,加-s : w ...
- linux包-下载-curl与wget
[root@localhost ~]# rpm -qa|grep curllibcurl-7.19.7-37.el6_4.x86_64python-pycurl-7.19.0-8.el6.x86_64 ...
- Linux学习:curl 与 wget命令
curl和wget命令都是Linux下的工具,可以用来下载文件. 一.wget 例1: wget http://www.minjieren.com/wordpress-3.1-zh_CN.zip 下载 ...
- Shell curl 和 wget 使用代理IP
Linux Shell 提供两个非常实用的命令来爬取网页,它们分别是 curl 和 wget curl 和 wget 使用代理 curl 支持 http.https.socks4.socks5 wge ...
- curl与wget
curl 和wget 区别 使用方法 可参考 curl vs Wget 1.curl是libcurl这个库支持的,wget是一个纯粹的命令行命令.2.curl支持更多的协议.curl supports ...
- curl和wget的区别和使用
curl和wget基础功能有诸多重叠,如下载等. 非要说区别的话,curl由于可自定义各种请求参数所以在模拟web请求方面更擅长:wget由于支持ftp和Recursive所以在下载文件方面更擅长.类 ...
- curl 与wget的区别
CURL与wget的区别 当想要直接通过linux 命令行下载文件,马上就能想到两个工具:wget 和 CURL.它们有很多一样的特征,可以很轻易的完成一些相同的任务,虽然它们有一些相似的特征,但它们 ...
- 开源http协议库curl和wget的区别和使用
curl和wget基础功能有诸多重叠,如下载等. 在高级用途上的curl由于可自定义各种请求参数所以长于模拟web请求,用于测试网页交互(浏览器):wget由于支持ftp和Recursive所以长于下 ...
- linux下载利器之curl和wget的区别
linux下载利器-------curl和wget的区别 curl和wget基础功能有诸多重叠,如下载等. 在高级用途上的curl由于可自定义各种请求参数所以长于模拟web请求,用于测试网页交互(浏览 ...
随机推荐
- easyUI 的tree 修改节点,sql递归查询
1.easyUI 的tree 修改节点: 我需要:切换语言状态,英文下, 修改根节点文本,显示英文. 操作位置:在tree的显示 $('#tree').tree(),onLoadSuccess事件方法 ...
- JSON 序列化和反序列化——JavaScriptSerializer实现
一. JavaScriptSerializer 类由异步通信层内部使用,用于序列化和反序列化在浏览器和 Web 服务器之间传递的数据.您无法访问序列化程序的此实例.但是,此类公开了公共 API.因此, ...
- SSH三大框架笔面试总结
Java工程师(程序员)面题 Struts,Spring,Hibernate三大框架 1.Hibernate工作原理及为什么要用? 原理: 1.读取并解析配置文件 2.读取并解析映射信息,创建Sess ...
- 可在广域网部署运行的QQ高仿版 -- GG叽叽V3.0,完善基础功能(源码)
(前段时间封闭式开发完了一个项目,最近才有时间继续更新GG的后续版本,对那些关注GG的朋友来说,真的是很抱歉.)GG的前面几个版本开发了一些比较高级的功能,像视频聊天.远程桌面.文件传送.远程磁盘等, ...
- Entity Framework返回IEnumerable还是IQueryable?
在使用EF的过程中,我们常常使用repository模式,本文就在repository层的返回值是IEnumerable类型还是IQueryable进行探讨. 阅读目录: 一.什么是Repositor ...
- [异常解决] android studio检测不到手机的解决办法——ADB驱动自己安装
用android studio搭建安卓开发环境比eclipse简单的多,仅仅下载一个1个G左右的安装包安装即可. 安装好之后随便建一个hello world工程,想用实体手机调试要点: 选择USB设备 ...
- 简化工作流程,10款必备的HTML5开发工具
利用HTML5工具不仅可以帮助设计师和开发者创建更具吸引力的网站,还能增加网站的可用性和可访问性.本文收集了10款HTML5开发工具让你在网页中搭建特效.动画.视频.音频等诸多功能,为你节省更多开发时 ...
- 几款开源的图形化Redis客户端管理软件
转载于:http://www.itxuexiwang.com/a/shujukujishu/redis/2016/0216/98.html?1455870209 Redis是一个超精简的基于内存的键值 ...
- Atitit 混合叠加俩张图片的处理 图像处理解决方案 javafx blend
Atitit 混合叠加俩张图片的处理 图像处理解决方案 javafx blend 1.1. Jhlabs 好像有了可以叠加算法,但是没有找到doc1 1.2. 自己算法叠加1 1.3. 使用javaf ...
- 常用 sql
一. sql 多个字段拼接 mysql: 1. concat函数 如果连接串中存在NULL,则返回结果为NULL: 例如: select concat('1','2','3') ...