Axel 是 Linux 下一个不错的HTTP/FTP高速下载工具。支持多线程下载、断点续传,且可以从多个地址或者从一个地址的多个连接来下载同一个文件。适合网速不给力时多线程下载提高下载速度。比如在国内VPS或服务器上下载lnmp一键安装包用Axel就比wget快。

    CentOS安装Axel:目前yum源上没有Axel,我们可以到http://pkgs.repoforge.org/axel/下载rpm包安装。32位CentOS执行下面命令:wget -c http://pkgs.repoforge.org/axel/axel-2.4-1.el5.rf.i386.rpm

rpm -ivh axel-2.4-1.el5.rf.i386.rpm。64位CentOS执行下面命令:wget -c http://pkgs.repoforge.org/axel/axel-2.4-1.el5.rf.x86_64.rpmrpm -ivh axel-2.4-1.el5.rf.x86_64.rpm

    Debian/Ubuntu安装Axel:apt-get install axel。Axel命令使用方法:axel 参数 文件下载地址可选参数:-n 指定线程数-o 指定另存为目录-s 指定每秒的最大比特数-q 静默模式如从Diahosting下载lnmp安装包指定10个线程,存到/tmp/:axel -n 10 -o /tmp/ http://soft.vpser.net/lnmp/lnmp0.7-full.tar.gz。如果下载过程中下载中断可以再执行下载命令即可恢复上次的下载进度。  http://axel.alioth.debian.org/ 下载后使用如下命令编译安装:
#tar zxvf axel-1.0a.tar.gz
#cd axel-1.0a/
#./configure
#make
#make install

基本的用法如下: #axel [选项] [下载目录] [下载地址]
[root@localhost axel-1.0a]# axel –help
Usage: axel [options] url1 [url2] [url...]

-s x Specify maximum speed (bytes per second)
-n x Specify maximum number of connections
-o f Specify local output file
-S [x] Search for mirrors and download from x servers
-N Just don”t use any proxy server
-q Leave stdout alone
-v More status information
-a Alternate progress indicator
-h This information
-V Version information

一个典型下载如下: #alex -n 10 -o /home/kennycx/ http://xxxx/jre.tar.gz

用10线程将指定路径的文件下载到/home/kennycx/这个目录下。

#设置代理
[root@localhost axel-1.0a]# export HTTP_PROXY=192.168.0.5:8080

#开始下载
[root@localhost axel-1.0a]# axel -n 10 -vo . http://xxx/xx.tar.gz

Initializing download: http://xxx/xx.tar.gz
File size: 1945089 bytes
Opening output file ./d4x-2.5.6.tar.gz
Starting download

[ 0%] ………. ………. ………. ………. ………. [ 15.3KB/s]
[ 2%] ………. ………. ………. ………. ………. [ 20.5KB/s]
[ 5%] ………. ………. ………. ………. ………. [ 26.3KB/s]
[ 7%] ………. ………. ………. ………. ………. [ 30.1KB/s]
[ 10%] ………. ………. ………. ………. ………. [ 34.0KB/s]
[ 13%] ………. ………. ………. ………. ………. [ 36.7KB/s]
[ 15%] ………. ………. ………. ………. ………. [ 39.0KB/s]
[ 18%] ………. ………. ………. ………. ………. [ 41.7KB/s]
[ 21%] ………. ………. ………. ………. ………. [ 42.7KB/s]
[ 23%] ………. ………. ………. ………. ………. [ 43.2KB/s]
[ 26%] ………. ………. ………. ………. ………. [ 44.6KB/s]
[ 28%] ………. ………. ………. ………. ………. [ 46.6KB/s]
[ 31%] ………. ………. ………. ………. ………. [ 46.6KB/s]
[ 34%] ………. ………. ………. ………. ………. [ 46.2KB/s]
[ 36%] ………. ………. ………. ………. ………. [ 47.5KB/s]
[ 39%] ………. ………. ………. ………. ………. [ 47.3KB/s]
[ 42%] ………. ………. ………. ………. ………. [ 47.9KB/s]
[ 44%] ………. ………. ………. ………. ………. [ 48.0KB/s]
[ 47%] ………. ………. ………. ………. ………. [ 47.2KB/s]
[ 50%] ………. ………. ………. ………. ………. [ 47.6KB/s]
[ 52%] ………. ………. ………. ………. ………. [ 47.2KB/s]
[ 55%] ………. ………. ………. ………. ………. [ 47.5KB/s]
[ 57%] ………. ………. ………. ………. ………. [ 47.8KB/s]
[ 60%] ………. ………. ………. ………. ………. [ 47.6KB/s]
[ 63%] ………. ………. ………. ………. ………. [ 47.8KB/s]
[ 65%] ………. ………. ………. ………. ………. [ 48.0KB/s]
[ 68%] ………. ………. ………. ………. ………. [ 48.0KB/s]
[ 71%] ………. ………. ………. ………. ………. [ 48.3KB/s]
[ 73%] ………. ………. ………. ……….
Connection 1 finished
,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, …….
Connection 3 finished
,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, ,,,,,,,… [ 48.1KB/s]
[ 76%] ………. ………. ………. ………. ………. [ 48.2KB/s]
[ 78%] ………. ………. ………. ………. ………. [ 47.9KB/s]
[ 81%] ………. ………. ………. ………. ………. [ 47.8KB/s]
[ 84%] ………. …….
Connection 6 finished
,,,,,,,,,, ,,,,,,,… ……….
Connection 5 finished
,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, ……….
Connection 2 finished
,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, ………. [ 47.1KB/s]
[ 86%] ….
Connection 8 finished
,,,,…..
Connection 4 finished
,,,,,,,,,. ………. ………. ………. ………. [ 43.6KB/s]
[ 89%] ………. ………. ………. ………. .
Connection 9 finished
,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, ,……
Connection 0 finished
,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, ,,,,,,,… [ 40.3KB/s]
[ 92%] ………. ………. ………. ………. ………. [ 35.0KB/s]
[ 94%] ………. ………. ………. ………. ………. [ 27.1KB/s]
[ 97%] ………. ………. ………. ………. ………

Downloaded 1899.5 kilobytes in 1:14 seconds. (25.60 KB/s)