linux运维在操作linux过程中,用得最多的linux下载工具想必一定是wget,没有看到哪一台服务器没装过wget的,或许有人使用ftp下载,也有人使用多线程的axel以及ProZilla,毫无疑问这两个工具都非常的出色,但是对于习惯使用wget的人来说显得不适应,于是老外便开发了多线程版本的wget工具mwget,m表示multi多线程的意思.

mwget
官方地址:http://sourceforge.net/projects/kmphpfm/?source=dlp

# cd /usr/local/src/
# wget http://jaist.dl.sourceforge.net/project/kmphpfm/mwget/0.1/mwget_0.1.0.orig.tar.bz2
# tar -xjvf mwget_0.1.0.orig.tar.bz2
# cd mwget_0.1.0.orig
# ./configure
# make
# make install

configure过程中如果出现如下错误,请安装大于等于0.35版本的intltool

checking for intltool >= 0.35.0... ./configure: line 6824: intltool-update: command not found
found
configure: error: Your intltool is too old. You need intltool 0.35.0 or later.
# yum install intltool

wget vs mwget速度测试
以下使用下载2.4.5版本的mongodb来取样.
mwget速度测试

# mwget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.4.5.tgz
Begin to download: mongodb-linux-x86_64-2.4.5.tgz
FileSize: 90M
36% [====> =====> ===> ====> ] [ 33M] [2.0M/s] [ETA:00:28]

mwget速度截图如下:

wget速度测试

# wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.4.5.tgz
--2013-08-16 10:55:23-- http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.4.5.tgz
Resolving fastdl.mongodb.org... 54.230.114.206, 54.230.113.36, 54.230.114.144, ...
Connecting to fastdl.mongodb.org|54.230.114.206|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 94827295 (90M) [application/x-tar]
Saving to: “mongodb-linux-x86_64-2.4.5.tgz.1”

6% [==> ] 6,470,547 210K/s eta 6m 26s

wget速度截图如下

mwget用法:

# mwget -h
GNU MWget 0.1.0 ,a non-interactive and multiline network retriever of all POSTIX Systems.
Usage: mwget [Options]... [URL]...
Options:
-b, --debug Show the debug message
-c, --count=num Set the retry count to [num], no limit when "0", the default is "99"
-d, --directory=dir Set 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"
-n, --number=num Use [num] connections instead of the default (4)
-r, --referer=URL Include `Referer: [URL]' header in HTTP request.
-t, --timeout=num Set the connection timeout to [num] seconds, the default is "30"
-v, --version Show the version of the mwget and exit
-x, --proxy=URL Set the proxy [URL]

Mail bug reports and suggestions to <sa@kmlinux.tk><xiao_suo@hotmail.com>
On website bug reports and suggestions to <http://mwget.sourceforge.net/> <http://www.kmlinux.tk/>
We Welcome your BUG REPORT!

Axel 
运维工作中,常常需要下载文件,因为网站下载速度限制或者网络等原因导致下载让人无法忍受,前面有介绍多线程wget工具mwget,提速不少,而且使用很简单。axel使用的人更多,不仅仅安装方法简单,命令更简单。往下看。
安装Axel
RPM安装Axel(方法一)
下载地址:http://pkgs.repoforge.org/axel/
如图,选择适合你服务器的RPM

root@ttlsa # wget http://pkgs.repoforge.org/axel/axel-2.4-1.el6.rf.x86_64.rpm
root@ttlsa # rpm -ivh axel-2.4-1.el6.rf.x86_64.rpm 
Preparing... ########################################### [100%]
1:axel ########################################### [100%]

yum安装Axel(方法二)

root@ttlsa # yum install axel

apt-get安装Axel
如果你是Ubuntu系统

root@ttlsa # axel -h
Usage: axel [options] url1 [url2] [url...]

--max-speed=x           -s x    最大速度 (字节/秒)
--num-connections=x     -n x    最大连接数
--output=f              -o f    指定文件名
--search[=x]            -S [x]  Search for mirrors and download from x servers
--header=x              -H x    添加header
--user-agent=x          -U x    设置用户代理
--no-proxy              -N      不使用任何代理
--quiet                 -q      Leave stdout alone
--verbose               -v      显示更多状态信息
--alternate             -a      显示简单进度条
--help                  -h      帮助
--version               -V      版本信息
 axel使用实例
下载centos

root@ttlsa # axel http://mirrors.btte.net/centos/6.5/isos/x86_64/CentOS-6.5-x86_64-bin-DVD1.iso
[ 1%] .......... .......... .......... .......... .......... [4654.5KB/s]
[ 1%] .......... .......... .......... .......... .......... [4657.1KB/s]
[ 1%] .......... .......... .......... .......... .......... [4656.5KB/s]
[ 1%] .......... .......... .......... .......... .......... [4659.3KB/s]

下载运维生存时间某图片

root@ttlsa # axel http://www.ttlsa.com/wp-content/uploads/2014/04/<a href="http://www.ttlsa.com/monitor/zabbix/" title="zabbix"target="_blank">zabbix</a>-adduser-01.jpg
Initializing download: http://www.ttlsa.com/wp-content/uploads/2014/04/zabbix-adduser-01.jpg
File size: 73009 bytes
Opening output file zabbix-adduser-01.jpg
Starting download</p> <p>root@ttlsa # axel http://www.ttlsa.com/wp-content/uploads/2014/04/zabbix-adduser-01.jpg
Initializing download: http://www.ttlsa.com/wp-content/uploads/2014/04/zabbix-adduser-01.jpg
File size: 73009 bytes
Opening output file zabbix-adduser-01.jpg
Starting download

[ 0%] .......... .......... .......... .......... .......... [ 598.0KB/s]
[ 70%] .......... .......... .
Connection 0 finished

Downloaded 71.3 kilobytes in 0 seconds. (710.02 KB/s)

简单进度条
默认情况下,整个屏幕都是进度条,加上-a参数,进度条类似wget。

root@ttlsa # axel -a http://mirrors.btte.net/centos/6.5/isos/x86_64/CentOS-6.5-x86_64-bin-DVD1.iso 
Initializing download: http://mirrors.btte.net/centos/6.5/isos/x86_64/CentOS-6.5-x86_64-bin-DVD1.iso
File size: 4467982336 bytes
Opening output file CentOS-6.5-x86_64-bin-DVD1.iso
Starting download</p> <p>[ 1%] [0 1 2 3 ] [ 3.2MB/s] [21:47]

下载限速
ttlsa的网站带宽有限制,我要保证下载的同时又不影响用户的访问,例如限制为1MB/s的下载速度,如下可以看到速度基本保证在1MB以内。

root@ttlsa # axel -s 1024000 http://mirrors.btte.net/centos/6.5/isos/x86_64/CentOS-6.5-x86_64-bin-DVD1.iso 
Initializing download: http://mirrors.btte.net/centos/6.5/isos/x86_64/CentOS-6.5-x86_64-bin-DVD1.iso
File size: 4467982336 bytes
Opening output file CentOS-6.5-x86_64-bin-DVD1.iso
State file found: 30522952 bytes downloaded, 4437459384 to go.
Starting download

,,,,,,,... .......... .......... .......... .......... [ 394.8KB/s]
[ 0%] .......... .......... .......... .......... .......... [ 689.2KB/s]
[ 0%] .......... .......... .......... .......... .......... [ 879.5KB/s]
[ 0%] .......... .......... .......... .......... .......... [ 974.5KB/s]
[ 0%] .......... .......... .......... .......... .......... [1086.4KB/s]
[ 0%] .......... .......... .......... .......... .......... [ 967.5KB/s]
[ 0%] .......... .......... .......... .......... .......... [ 943.8KB/s]
[ 0%] .......... .......... .......... .......... .......... [1021.0KB/s]
[ 0%] .......... .......... .......... .......... .......... [1066.1KB/s]

最后
完成,方法很简单,功能很简单。运维生存时间的服务器以及安装了axel,你的安装了吗?

Linux下多线程下载工具MWget和Axel使用介绍的更多相关文章

  1. Linux下多线程下载工具myget

    [root@superdba ~]# mytgetMytget 0.0.99: A download accelerator for GNU/LinuxUsage: mytget [options]. ...

  2. Linux下多线程下载工具 - Axel

    Axel 是 Linux 下一个不错的HTTP/FTP高速下载工具.支持多线程下载.断点续传,且可以从多个地址或者从一个地址的多个连接来下载同一个文件.适合网速不给力时多线程下载提高下载速度.比如在国 ...

  3. Axel linux下多线程下载工具

    Axel 是 Linux 下一个不错的HTTP/FTP高速下载工具.支持多线程下载.断点续传,且可以从多个地址或者从一个地址的多个连接来下载同一个文件.适合网速不给力时多线程下载提高下载速度.比如在国 ...

  4. linux多线程下载工具mwget

    linux多线程下载工具mwget 经常使用wget进行文件下载,然而wget的处理速度并不如人意.遇到一些国外的站点,经常慢得像蜗牛一般.然而为了解决这个问题,便有了mwget:m表示multi多线 ...

  5. Linux下的下载工具介绍----aria2

    ariac 项目地址:http://aria2.sourceforge.net/ 下载地址:http://sourceforge.net/projects/aria2/files/stable/ari ...

  6. Linux下的多线程下载工具mwget

    之前在做项目的时候,遇到一个难题,需要一个多线程下载器,于是阴差阳错的看到了这款工具--mwget,之所以是阴差阳错,是因为mwget的多线程下载功能,并不是我们想要的多线程. wget大家都知道吧, ...

  7. linux常用多线程下载工具

    1.axel 下载安装yum install axel 这个软件下载速度实时显示

  8. Linux下多线程下载利器 axel

    参考 https://teddysun.com/377.html 使用示例: axel -an https://ubuntu-mate.org/raspberry-pi/ubuntu-mate-16. ...

  9. Linux下多线程查看工具(pstree、ps、pstack),linux命令之-pstree使用说明, linux 查看线程状态。 不指定

    0.最常用 pstree:[root@iZ25dcp92ckZ temp]# pstree -a|grep multe  |       |   `-multepoolser  |       |   ...

随机推荐

  1. 基础-Eclipse 教程

    1.Eclipse 是一个开放源代码的.基于 Java 的可扩展开发平台.2.下载地址为: https://www.eclipse.org/downloads/.3.Eclipse 修改字符集 : W ...

  2. JavaScript------分页插件下载地址

    转载: https://github.com/pgkk/kkpager

  3. elasticsearch.net search入门使用指南中文版

    原文:http://edu.dmeiyang.com/book/nestusing.html elasticsearch.net为什么会有两个客户端? Elasticsearch.Net是一个非常底层 ...

  4. 让python pip使用国内镜像

    国内源: 清华:https://pypi.tuna.tsinghua.edu.cn/simple 阿里云:http://mirrors.aliyun.com/pypi/simple/ 中国科技大学 h ...

  5. 【BZOJ4597】[Shoi2016]随机序列 线段树

    [BZOJ4597][Shoi2016]随机序列 Description 你的面前有N个数排成一行.分别为A1, A2, … , An.你打算在每相邻的两个 Ai和 Ai+1 间都插入一个加号或者减号 ...

  6. 【BZOJ4378】[POI2015]Logistyka 树状数组

    [BZOJ4378][POI2015]Logistyka Description 维护一个长度为n的序列,一开始都是0,支持以下两种操作:1.U k a 将序列中第k个数修改为a.2.Z c s 在这 ...

  7. Leetcode-Combinations Sum II

    Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in ...

  8. [Navicat] 常用快捷键及注意事项

    近来需要同时管理多种类型.多台server的数据库,在经历了各种查询客户端(SSMS, SQLyog, PL/SQL等)的不断切换,ip/user/pwd的反复输入的这种自虐式体验后,实在无法忍受,就 ...

  9. 巨蟒python全栈开发数据库攻略4:多表操作&Navicat&pymysql

    1.多表查询 2.连表补充 3.boss工具=>Navicat 4.索引加速寻找工具=>everything 5.pymysql 6.pymysql初识 7.pymysql的各个方法

  10. Let's encrypt申请泛域名证书以及报错处理

    申请泛域名证书的步骤请参考该链接地址: https://www.jianshu.com/p/df6d13187578 报错信息: No matching distribution found for ...