Linux命令行多线程、断点续传下载工具

#####################################################

##如有转载,请务必保留本文链接及版权信息

##欢迎广大运维同仁一起交流linux/unix网站运维技术!

##QQ:335623998

##E-mail:335623998@qq.com

#####################################################

运维工作中常会在linux命令行下载外网文件或内网进行大文件传输,经常使用的文本下载工具wget、curl,今天给大家推荐支持Linux命令行多线程、断点续传下载工具axel和myget。

1、系统环境

# lsb_release -a

LSB Version: :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch

Distributor ID: CentOS

Description: CentOS release 5.8 (Final)

Release: 5.8

Codename: Final

2、下载工具安装、使用方法介绍

2.1 wget

CentOS 默认已经安装,如需安装请运行

# yum install wget -y

wget版本信息

# wget -V

GNU Wget 1.11.4 Red Hat modified

此工具比较常用,使用方法、参数略

2.2 Axel 下载 安装

官方站点

源码包地址

?group_id=100070

最新版本axel-2.4源码包下载地址

rpm包地址

选择下载对应系统的rpm包

# wget

安装axel

# rpm -ivh axel-2.4-1.el5.rf.x86_64.rpm

axel版本

# axel -V

Axel version 2.4 (Linux)

axel命令使用方法:

axel [选项参数] url1 [url2] [url……]

axel 参数:

-s x

Specify maximum speed (bytes per second)

–num-connections=x

-n x#连接数

Specify maximum number of connections

–output=f#下载为本地文件

-o f

Specify local output file

–search[=x] #搜索镜像

-S [x]

Search for mirrors and download from x servers

–header=x

-H x #添加头文件字符串

Add header string

–user-agent=x#设置UA

-U x

Set user agent

–no-proxy #不使用代理服务器

-N

Just don’t use any proxy server –quiet

–quiet, -q

No output to stdout. #静默模式,不输出到标准输出

–verbose

-v

More status information #更多状态信息

–alternate

–help #帮助

-h

–version#版本

-V

2.3 myget 下载、安装

[root@cobbler-1014 ~]# wget

[root@cobbler-1014 ~]# tar zxf myget-0.1.2.tar.gz

[root@cobbler-1014 ~]# cd myget-0.1.2

# ./configure && make && make install

mytget版本,注意myget命令为mytget

# mytget -v

myget 0.1.1

命令mytget用法

mytget [选项] [url]

参数

-b,–debug Show the debug message #看调试信息

-c,–count=num Set the retry count to [num], no limit when "0", the default is "99" #设置重试次数,0为无限,默认是99次。

-d,–directory=dirSet the local direcotry to [dir], the default is "." #指定下载本地目录,默认是当前目录

-f,–file=file Rename the file to [file]#重命名下载到本地的文件名

-h,–help A brief summary of all the options#简短的帮助摘要

-i,–interval=num Set the ftp retry interval to [num] seconds, the default is "5" #设置ftp重试间隔,单位s,默认5秒

-n,–number=num Use [num] connections instead of the default (4) #指定连接数,默认4

-r,–referer=URL Include `Referer: [URL]’ header in HTTP request.#包含请求头 Referer

-t,–timeout=num Set the connection timeout to [num] seconds, the default is "30" #设置连接超时时间,香港虚拟主机,默认30秒

-v,–version Show the version of the myget and exit#查看版本信息

-x,–proxy=URL Set the proxy [URL]#设置代理

3、wget、axel、myget测试下载速度对比

3.1 下载速度对比

说明:同一台机器下载同一个数据源链接

3.1.1 wget下载

# wget

–2013-03-11 09:29:46–

Connecting to 10.0.251.154:80… connected.

HTTP request sent, awaiting response… 200 OK

Length: 4353378304 (4.1G) [application/octet-stream]

Saving to: `CentOS-6.4-x86_64-bin-DVD1.iso’

鱼儿爱美,不仅需要鳞甲之美。还需要浮沉活泼之美。

Linux命令行多线程、断点续传下载工具

相关文章:

你感兴趣的文章:

标签云: