邪恶八进制信息安全团队技术讨论组's Archiver

goldberg 2006-11-10 13:17

[转载]Linux下多线程下载工具

信息来源:不详

MyGet [推荐]
MyGet目标设计成一个可扩展的,拥有丰富界面的多线程下载工具,它支持HTTP、FTP、HTTPS等协议。
              

              
                在[url]http://myget.sourceforge.net/[/url]下
载其最新版本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 [url]http://user:pass@host:port[/url]”。
  -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 [url]http://192.168.0.5:8080[/url]  -d ./  [url]http://..../myget-0.1.0.tar.bz2[/url]
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的几倍。

  可在[url]http://www.linuxfans.org/nuke/modules.php?name=Site_Downloads&op=mydown&did=1697[/url]下
载。

  下载后使用如下命令编译安装:
  #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/        [url]http://xxxx/jre.tar.gz[/url]

  用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 .  [url]http://xxx/xx.tar.gz[/url]


Initializing download: [url]http://xxx/xx.tar.gz[/url]

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的下载地址为[url]http://www.krasu.ru/soft/chuchelo/files/d4x-2.5.0final.tar.gz[/url],
下载后使用如下命令安装:
   #tar zxvf d4x-2.5.0final.tar.gz
   #cd d4x-2.5.0final

   #./configure
   #make
   #make install

成功安装后,运行“d4x”命令便可直接运行。它的界面如图3所示,和FlashGet有点相像吧。
[img]http://www.ossw.com.cn/upload_files_1124395518/news//6_218.247.237.254__2005_09_20_13_08_27_.jpg[/img]
2.使用和设置
   
D4X的使用十分简单,下载文件时,只需在“添加新的下载任务”对话框中输入下载文件地址即可。如果下载地址需要用户名和密码,可在这个对话框中直接输
入。如要计划下载,可在时间选项中设定下载时间。此外,在下载任务选项中,可设定一些下载的配置,如下载文件默认目录、默认线程个数、界面风格等。值得一
提是代理选项,可指定默认的代理服务器和SOCKS5代理,具体设置如图4所示。
[img]http://www.ossw.com.cn/upload_files_1124395518/news//6_218.247.237.254__2005_09_20_13_08_44_.jpg[/img]
=========================================================

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 [url]mms://www.hehe.com/[/url]***.wma -t 3
使用3个线程下载***.wma

./asfr -P [url]http://proxy:8080[/url]  [url]mms://www.hehe.com/[/url]***.wma

使用代理服务器proxy:8080下载***.wma



./asfr [url]mms://www.hehe.com/[/url]***.wma -T

强制用MMST协议下载***.wma



退出程序:Ctrl+Break


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


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


1)图形界面下载工具
  
D)WxDfast
   WxDfast也是一个图形化的下载工具,支持多线程、断点续传等功能,最大特点是下载速度快。可在[url]http://heanet.dl.sourceforge.net/sourceforge/dfast/wxdfast-0.2.1-src.tar.gz[/url]下
载WxDfast的最新版本。然后使用如下命令进行安装:
   #tar jxvf wxdfast-0.2.1d.tar.bz2
   #cd
wxdfast-0.2.1-src
   #make install
  
在终端下运行“./wxdfast”命令便可运行程序。WxDfast界面非常简洁,其界面如图5所示。全英文界面使用起来可能不如KGet方便,好在它
的操作和KGet、D4X基本相同,大家可参照学习,这里就不赘述了。
[img]http://www.ossw.com.cn/upload_files_1124395518/news//6_218.247.237.254__2005_09_20_13_09_03_.jpg[/img]
E)Aria
    Aria是个小巧的多线程下载工具,简单易用的界面用起来得心应手。
    可在[url]http://aria.rednoah.com/download_e.html[/url]下载最新版本,然后使用如下命令进行编译安装:
   #./configure
   #make
   #make install 成功安装后直接运行如下命令便可运行Aria:
   #aria&

   Aria的界面如图6所示,它的操作和D4X差不多,可参照使用。
[img]http://www.ossw.com.cn/upload_files_1124395518/news//6_218.247.237.254__2005_09_20_13_09_22_.jpg[/img]
2)命令行下载工具
  对于喜欢命令行操作及追求高效率、高速度下载的朋友,推荐使用命令行下载工具。命令行工具不但使用方便,而且大多具有很高的下载速度及下载效率,尤其适合于大批量下载文件。下面就为大家详细介绍一下这些工具。

A)Wget
  Wget是一个十分常用命令行下载工具,多数Linux发行版本都默认包含这个工具。

  如果没有安装可在[url]http://www.gnu.org/software/wget/wget.html[/url]下载最新版本,并使用如下命令编译安装:
  #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还可下载整个网站,如下载[url]http://man.chinaunix.net[/url]整个Man手册中心。只需输入如下命令即可: #wget -r -p -np -k [url]http://man.chinaunix.net[/url]

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


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

  可到[url]http://prozilla.genesys.ro/[/url]下载最新的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 [url]http://64.12.204.21/pub/mozilla.org/firefox/releases/1.0/linux-i686/zh-CN/firefox-1.0.installer.tar.gz[/url]

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

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




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

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

  然后使用如下命令进行编译安装:
  #tar zxvf linuxdown-1.1.0.tar.gz
  #cd dandelion/
  #make
  #make install linuxdown

  格式为: #linuxdown [下载地址] [选项] [线程数]
  需要注意的是下载地址和选项都需要西文引号括起来,线程数不可超过30个。一个典型的下载如下:
  #linuxdown "[url]http://xxx/xxx.zip[/url]" 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 [url]http://192.168.0.5:8080[/url] -d ./ [url]http://www.krasu.ru/soft/chuchelo/files/d4x-2.5.6.tar.gz[/url]
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 [url]http://192.168.0.5:8080[/url] -d ./ [url]http://www.krasu.ru/soft/chuchelo/files/d4x-2.5.6.tar.gz[/url]
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 ./ [url]http://www.krasu.ru/soft/chuchelo/files/d4x-2.5.6.tar.gz[/url]
Initializing download: [url]http://www.krasu.ru/soft/chuchelo/files/d4x-2.5.6.tar.gz[/url]
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 ./ [url]http://www.krasu.ru/soft/chuchelo/files/d4x-2.5.6.tar.gz[/url]
Initializing download: [url]http://www.krasu.ru/soft/chuchelo/files/d4x-2.5.6.tar.gz[/url]
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快速\稳定

页: [1]
© 1999-2008 EvilOctal Security Team