文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Linux下多线程下载工具

Linux下多线程下载工具

时间:2006-02-15  来源:cnscn2008

MyGet [推荐]
MyGet目标设计成一个可扩展的,拥有丰富界面的多线程下载工具,它支持HTTP、FTP、HTTPS等协议。
  在http://myget.sourceforge.net/下 载其最新版本0.1.0,
 
  下载后使用如下命令安装:
   #tar jxvf myget-0.1.0.tar.bz2
   #cd myget-0.1.0
   #./configure
   #make
   #make install

   MyGet命令格式如下: #mytget [选项] [下载地址]
   常用的选项:
   -d  [目录]:指定下载到的文件在本地存放的位置,默认当前目录。
   -f  [文件]:指定下载到本地后的新文件名称。
   -h  帮助选项。
   -n  [线程数]:下载线程数量,默认为4个。
   -x  [代理服务器地址]:设置代理服务器地址,如“-x http://user:pass@host:port”。
   -b  Show the debug message
   -c  Set the retry count to [num], no limit when "0", the default is "99"
   -i  Set the ftp retry interval to [num] seconds, the default is "5"
   -r  Include `Referer: [URL]' header in HTTP request.
   -t  Set the connection timeout to [num] seconds, the default is "30"
   -v  Show the version of the myget and exit
   -x  Set the proxy [URL]

 

[root@localhost myget-0.1.0]# mytget  -n 10  -x http://192.168.0.5:8080  -d ./  http://..../myget-0.1.0.tar.bz2
Begin to download: myget-0.1.0.tar.bz2
Filesize: 222K
100% [==========================================================================================] [228K] [5.6K/s] [ETA:00:-1]Download successfully in 00:11


===========================================================

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

  可在http://www.linuxfans.org/nuke/modules.php?name=Site_Downloads&op=mydown&did=1697下 载。
 
  下载后使用如下命令编译安装:
   #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)


=========================================================

D4X
     Downloader For X(文中简称为D4X)是Linux下功能强大的图形化下载工具。
     支持HTTP与FTP协议,
     具有类似NetAnt和FlashGet等多线程、
     断点续传 下载
     具有连接超时断点续传
     记录下载日志
     模拟下载
     链接拖拽下载
     自动复制剪贴板链接到下载地址栏中等功能。

   1.下载和安装 D4X的下载地址为http://www.krasu.ru/soft/chuchelo/files/d4x-2.5.0final.tar.gz, 下载后使用如下命令安装:
    #tar zxvf d4x-2.5.0final.tar.gz
    #cd d4x-2.5.0final
    #./configure
    #make
    #make install
成功安装后,运行“d4x”命令便可直接运行。它的界面如图3所示,和FlashGet有点相像吧。 500) this.width=500" onmousewheel="return bbimg(this)" border="0" width="500">
     2.使用和设置
       D4X的使用十分简单,下载文件时,只需在“添加新的下载任务”对话框中输入下载文件地址即可。如果下载地址需要用户名和密码,可在这个对话框中直接输 入。如要计划下载,可在时间选项中设定下载时间。此外,在下载任务选项中,可设定一些下载的配置,如下载文件默认目录、默认线程个数、界面风格等。值得一 提是代理选项,可指定默认的代理服务器和SOCKS5代理,具体设置如图4所示。 500) this.width=500" onmousewheel="return bbimg(this)" border="0" width="500">



=========================================================

mms协议流媒体下载工具
[来源]http://www.5anet.com/?module=bbs&object=bbs&action=showdetail&id=13
[作者]黄叶
ASFR+ 是一个专门用来下载 ASF、Wma、Wmv 格式流文件的工具.此软件是国内的 Yaan2 同志在ASFRecorder 代码的基础上加以改进做出的,这个软件在ASFRecorder 的基础上加上了分断下载、修复损坏 ASF 文件、多线程下载ASF文件,断点续传等功能。唯一遗憾就是没有GUI界面。
安装方法:tar zxvf asfrplus.tgz
cd asfrplus
make
在asfrplus目录会生成一个文件名为"asfr"的可执行文件。
下面是它的基本用法:
进入asfrplus的目录,输入:
./asfr mms://www.hehe.com/***.wma -t 3
使用3个线程下载***.wma

./asfr -P http://proxy:8080  mms://www.hehe.com/***.wma
使用代理服务器proxy:8080下载***.wma

./asfr mms://www.hehe.com/***.wma -T
强制用MMST协议下载***.wma

退出程序:Ctrl+Break

大小: 47KB
下载: http://www.5anet.com/software/asfrplus.tgz


=========================================================

1)图形界面下载工具
 
D)WxDfast
    WxDfast也是一个图形化的下载工具,支持多线程、断点续传等功能,最大特点是下载速度快。可在http://heanet.dl.sourceforge.net/sourceforge/dfast/wxdfast-0.2.1-src.tar.gz下 载WxDfast的最新版本。然后使用如下命令进行安装:
    #tar jxvf wxdfast-0.2.1d.tar.bz2
    #cd wxdfast-0.2.1-src
    #make install
    在终端下运行“./wxdfast”命令便可运行程序。WxDfast界面非常简洁,其界面如图5所示。全英文界面使用起来可能不如KGet方便,好在它 的操作和KGet、D4X基本相同,大家可参照学习,这里就不赘述了。 500) this.width=500" onmousewheel="return bbimg(this)" border="0" width="500">

E)Aria
     Aria是个小巧的多线程下载工具,简单易用的界面用起来得心应手。
     可在http://aria.rednoah.com/download_e.html下载最新版本,然后使用如下命令进行编译安装:
    #./configure
    #make
    #make install 成功安装后直接运行如下命令便可运行Aria:
    #aria&

    Aria的界面如图6所示,它的操作和D4X差不多,可参照使用。 500) this.width=500" onmousewheel="return bbimg(this)" border="0" width="500">

2)命令行下载工具
  对于喜欢命令行操作及追求高效率、高速度下载的朋友,推荐使用命令行下载工具。命令行工具不但使用方便,而且大多具有很高的下载速度及下载效率,尤其适合 于大批量下载文件。下面就为大家详细介绍一下这些工具。

 A)Wget
   Wget是一个十分常用命令行下载工具,多数Linux发行版本都默认包含这个工具。
 
   如果没有安装可在http://www.gnu.org/software/wget/wget.html下 载最新版本,并使用如下命令编译安装:
   #tar zxvf wget-1.9.1.tar.gz
   #cd wget-1.9.1
   #./configure
   #make
   #make install

   它的用法很简单,Wget使用格式如下: #wget [选项] [下载地址]
 
   Wget常用参数
      ◆-b:后台下载,Wget默认的是把文件下载到当前目录。
      ◆-O:将文件下载到指定的目录中。
      ◆-P:保存文件之前先创建指定名称的目录。
      ◆-t:尝试连接次数,当Wget无法与服务器建立连接时,尝试连接多少次。
      ◆-c:断点续传,如果下载中断,那么连接恢复时会从上次断点开始下载。

     HTTP和FTP代理功能,编辑其配置文件“/etc/wgetrc”即可。具体方法是使用VI编辑器打开上述文件,将 “http_proxy”和“ftp_proxoy”前的#去掉,然后在这两项后输入相应的代理服务器的地址,保存退出即可。

     Wget还可下载整个 网站,如下载http://man.chinaunix.net整个Man手册中心。只需输入如下命令即可: #wget -r -p -np -k http://man.chinaunix.net

    其中-r   参数是指使用递归下载,
       -p   是指下载所有显示完整网页所以需要的文件,如图片等,
       -np  是指不搜索上层目录,-k则是指将绝对链接转换为相对链 接。

B)Prozilla
  Prozilla也是一个十分流行的命令行下载工具,支持多线程下载和断点续传功能, 但未找到代理支持功能

  可到http://prozilla.genesys.ro/下 载最新的1.3.7.4安装包,下载安装包后使用如下命令进行安装:
 
  #tar zxvf prozilla-1.3.7.4.tar.gz
  #cd prozilla-1.3.7.4
  #./configure
  #make
  #make install Prozilla

  命令格式如下: #proz [参数] [下载地址]
  常用的选项有:
     ◆-k=n :设置n个线程下载。不加此参数指定线程数,Prozilla默认为4线程下载。
     ◆-P, --directory-prefix=DIR:指定将下载的文件保存在DIR/目录。
     ◆-r, --resume:继续下载未完成的文件。如果要指定线程数下载可用如下命令: #proz -k=5 http://64.12.204.21/pub/mozilla.org/firefox/releases/1.0/linux-i686/zh-CN/firefox-1.0.installer.tar.gz

     这样便以5线程进行文件的下载,并将文件保存到当前目录。

     和Wget一样,Prozilla也提供了续传功能,下载中断后,重新输入上述命令,就会出现提 示续传,按R键就可继续下载了。




D)Linuxdown
  Linuxdown是一个命令行多线程下载工具,最多可支持30线程的下载, 但未找到代理支持功能

  在https://gro.clinux.org/frs/download.php/1015/linuxdown-1.0.0.tar.gz下 载最新的1.1.0版本。

  然后使用如下命令进行编译安装:
   #tar zxvf linuxdown-1.1.0.tar.gz
   #cd dandelion/
   #make
   #make install linuxdown
 
   格式为: #linuxdown [下载地址] [选项] [线程数]
   需要注意的是下载地址和选项都需要西文引号括起来,线程数不可超过30个。一个典型的下载如下:
   #linuxdown "http://xxx/xxx.zip" 30


=================================================================

下载同一个程序时的CPU比例
PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
14549 root      25   0 70660  17m 9780 R 73.1  1.8   2:59.92 wxdfast
14558 root      15   0  152m  18m  10m S  2.9  2.0   0:04.43 d4x 

下载速度比较
[root@localhost Desktop]# mytget -n 10 -x http://192.168.0.5:8080 -d ./ http://www.krasu.ru/soft/chuchelo/files/d4x-2.5.6.tar.gz
Begin to download: d4x-2.5.6.tar.gz
Filesize: 1.9M
100% [===============================================================================> =========] [1.9M] [7.3K/s] [ETA:00:00]
Download successfully in 01:18

[root@localhost Desktop]# mytget -n 10 -x http://192.168.0.5:8080 -d ./ http://www.krasu.ru/soft/chuchelo/files/d4x-2.5.6.tar.gz
Begin to download: d4x-2.5.6.tar.gz
Filesize: 1.9M
100% [==================================> =======> =============================================] [1.9M] [4.7K/s] [ETA:00:00]
Download successfully in 01:21

[root@localhost Desktop]# axel  -n 10  -o ./ http://www.krasu.ru/soft/chuchelo/files/d4x-2.5.6.tar.gz
Initializing download: http://www.krasu.ru/soft/chuchelo/files/d4x-2.5.6.tar.gz
File size: 1945089 bytes
Opening output file .//d4x-2.5.6.tar.gz
Starting download
.........
Downloaded 1899.5 kilobytes in 2:11 seconds. (14.47 KB/s)

[root@localhost Desktop]# axel  -n 10  -o ./ http://www.krasu.ru/soft/chuchelo/files/d4x-2.5.6.tar.gz
Initializing download: http://www.krasu.ru/soft/chuchelo/files/d4x-2.5.6.tar.gz
File size: 1945089 bytes
Opening output file .//d4x-2.5.6.tar.gz
Starting download

..............

Downloaded 1899.5 kilobytes in 1:22 seconds. (23.06 KB/s)

结果:myget比axel快速\稳定

作者:陈杰
整理: cnscn
[来源]:http://www.ossw.com.cn/bencandy.php?id=130
相关阅读 更多 +
排行榜 更多 +
合合合军团

合合合军团

策略塔防 下载
街头滑板

街头滑板

体育竞技 下载
武者生存

武者生存

体育竞技 下载