linux命令行下多线程下载工具-axel

2008年5月5日 | 00:01分类:linux | 标签: | 233 views

linux命令行下多线程下载工具-axel

在Linux 命令行下多线程的下载工具,支持断点续传,速度通常情况下是Wget的几倍。

下载、编译、安装

官方地址:http://wilmer.gaast.net/main.php/axel.html

[root@test src]# wget http://wilmer.gaast.net/downloads/axel-1.0b.tar.gz  ←下载程序源文件
--22:59:44--  http://wilmer.gaast.net/downloads/axel-1.0b.tar.gz
           => `axel-1.0b.tar.gz'
Resolving wilmer.gaast.net... 82.92.174.89
Connecting to wilmer.gaast.net|82.92.174.89|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 43,293 (42K) [application/x-tar]

100%[====================================>] 43,293         9.85K/s    ETA 00:00>

22:59:49 (9.85 KB/s) - `axel-1.0b.tar.gz' saved [43293/43293]

[root@test src]# tar zxvf axel-1.0b.tar.gz      ←解压下载文件
axel-1.0b/
axel-1.0b/gui/
axel-1.0b/gui/kapt/
axel-1.0b/gui/kapt/axel-kapt
axel-1.0b/gui/kapt/Makefile
axel-1.0b/gui/kapt/axel-kapt.desktop
axel-1.0b/gui/kapt/axel-kapt.1
axel-1.0b/CHANGES
axel-1.0b/API
axel-1.0b/axelrc.example
axel-1.0b/COPYING
axel-1.0b/CREDITS
axel-1.0b/Makefile
axel-1.0b/README
axel-1.0b/axel.1
axel-1.0b/axel.c
axel-1.0b/axel.h
axel-1.0b/configure
axel-1.0b/conf.c
axel-1.0b/conf.h
axel-1.0b/conn.c
axel-1.0b/conn.h
axel-1.0b/de.po
axel-1.0b/ftp.c
axel-1.0b/ftp.h
axel-1.0b/http.c
axel-1.0b/http.h
axel-1.0b/nl.po
axel-1.0b/search.c
axel-1.0b/search.h
axel-1.0b/tcp.c
axel-1.0b/tcp.h
axel-1.0b/text.c
[root@test src]# cd axel-1.0b  ←进入解压后的文件目录
[root@test axel-1.0b]# ./configure   ←预设置编译
The strip option is enabled. This should not be a problem usually, but on some
systems it breaks stuff.

Configuration done:
  Internationalization disabled.
  Debugging disabled.
  Binary stripping enabled.
[root@test axel-1.0b]# make   ←编译源文件
gcc -c axel.c -o axel.o -Wall -O3
gcc -c conf.c -o conf.o -Wall -O3
gcc -c conn.c -o conn.o -Wall -O3
gcc -c ftp.c -o ftp.o -Wall -O3
gcc -c http.c -o http.o -Wall -O3
gcc -c search.c -o search.o -Wall -O3
gcc -c tcp.c -o tcp.o -Wall -O3
gcc -c text.c -o text.o -Wall -O3
gcc axel.o conf.o conn.o ftp.o http.o search.o tcp.o text.o -o axel  -lpthread
strip axel
[root@test axel-1.0b]# make install   ←安装程序
mkdir -p /usr/local/bin/n
cp axel /usr/local/bin/axel
mkdir -p /usr/local/etc/
cp axelrc.example /usr/local/etc/axelrc
mkdir -p /usr/local/share/man/man1/
cp axel.1 /usr/local/share/man/man1/axel.1
[root@test axel-1.0b]#

axel用法

基本的用法如下: #axel [选项] [下载目录] [下载地址]

[root@test axel-1.0b]# axel --help  ←查看axel帮助
Usage: axel [options] url1 [url2] [url...]

--max-speed=x           -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
--no-proxy              -N      Just don't use any proxy server
--quiet                 -q      Leave stdout alone
--verbose               -v      More status information
--alternate             -a      Alternate progress indicator
--help                  -h      This information
--version               -V      Version information

Report bugs to lintux@lintux.cx
[root@test axel-1.0b]#
一个典型的下载应用
[root@test axel-1.0b]# axel  -n 10  -vo . http://your-domain.com/test.tar.gz  ←用10线程将指定路径的文件
                                                                                下载到当前的工作目录下

initializing download: http://your-domain.com/test.tar.gz
File size: 1945089 bytes
Opening output file ./test.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)

发表您的评论

您的名字: (*必填)

您的邮箱: (*不会被公布 ,必填)

您的网站: