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请求,用于测试网页交互(浏览 ...
随机推荐
- spark on centos6.5 安装
第一步在centos 6.5上安装java 运行环境 http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-18 ...
- XtraBackup备份笔记
安装 rpm -Uhv http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm yum in ...
- Fedora23Server配置
系统准备 启动网卡: sudo service network start 更新系统: sudo dnf update 远程管理: https://IP:9090/ Dnf使用: http://www ...
- 可在广域网部署运行的QQ高仿版 -- GG叽叽V2.4,增加远程协助、桌面共享功能(源码)
QQ的远程协助.或者说桌面共享是一个非常实用的功能,所以,2.4版本的GG复制了它,而且,GG增强了桌面共享的功能,它可以允许指定要共享桌面的区域,这样,对方就只能看到指定区域的桌面,这对节省流量会非 ...
- ENode 2.0 - 整体架构介绍
前言 今天是个开心的日子,又是周末,可以轻轻松松的写写文章了.去年,我写了ENode 1.0版本,那时我也写了一个分析系列.经过了大半年的时间,我对第一个版本做了很多架构上的改进,最重要的就是让ENo ...
- Java虚拟机12:Java内存模型
什么是Java内存模型 Java虚拟机规范中试图定义一种Java内存模型(Java Memory Model,JMM)来屏蔽掉各种硬件和操作系统的访问差异,以实现让Java程序在各种平台下都能达到一致 ...
- 学习设计模式第三 - 基础使用UML表示关系
面向对象的思想中存在如下几种关系,一般为了方便交流都使用UML的类图来展现类之间的关系.所以了解类图中符号的含义对看懂类图,尤其是用类图展示的设计模式很有帮助.下面依次介绍这几种关系 类继承关系 继承 ...
- Windows桌面共享中一些常见的抓屏技术
1. BitBlt 我想做Windows开发应该都知道这个API, 它能实现DC间的内容拷贝, 如果我们把源DC指定成Monitor DC或是桌面DC, 它就能实现抓屏功能. 对于通过这种方式的抓屏, ...
- http学习笔记(三)
几乎所有的http通信都是由TCP/IP承载的.http好比一辆汽车,而TCP是一条公路,所有的汽车都要在公路上跑,看看http是如何在tcp这条公路上往返的. 首先简单地看看tcp,TCP连接是通过 ...
- 使用MYSQL命令直接导入导出SQL文件
很多时候,我们的数据开发都会用到很多开发利器,比如powerdesigner, navicat等这些软件,虽然好用,但是要收费,在公司里面是禁止使用盗版软件的,怕罚款各方面的,所以我们也不敢直接在公司 ...