# lsb_release -a LSB Version: :core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch Distributor ID: CentOS Description: CentOS release 5.8 (Final) Release: 5.8 Codename: Final
# yum install wget -y wget版本信息 # wget -V GNU Wget 1.11.4 Red Hat modified此工具比較常用,使用方法、參數略
--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 --header=x -H x #添加頭文件字符串 Add header string --user-agent=x #設置UA -U x Set user agent --no-proxy #不使用代理服務器 -N Just don't use any proxy server --quiet --quiet, -q No output to stdout. #靜默模式,不輸出到標准輸出 --verbose -v More status information #更多狀態信息 --alternate --help #幫助 -h --version #版本 -V
-b, --debug Show the debug message #看調試信息 -c, --count=num Set the retry count to [num], no limit when "0", the default is "99" #設置重試次數,0為無限,默認是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" #設置ftp重試間隔,單位s,默認5秒 -n, --number=num Use [num] connections instead of the default (4) #指定連接數,默認4 -r, --referer=URL Include `Referer: [URL]' header in HTTP request. #包含請求頭 Referer -t, --timeout=num Set the connection timeout to [num] seconds, the default is "30" #設置連接超時時間,默認30秒 -v, --version Show the version of the myget and exit #查看版本信息 -x, --proxy=URL Set the proxy [URL] #設置代理
# wget http://url/iso/Centos/x86_64/CentOS-6.4-x86_64-bin-DVD1.iso --2013-03-11 09:29:46-- http://url/iso/Centos/x86_64/CentOS-6.4-x86_64-bin-DVD1.iso Connecting to 10.0.251.154:80... connected. HTTP request sent, awaiting response... 200 OK Length: 4353378304 (4.1G) [application/octet-stream] Saving to: `CentOS-6.4-x86_64-bin-DVD1.iso' 0% [ ] 18,526,067 1.60M/s eta 46m 21s
# axel http://url/iso/Centos/x86_64/CentOS-6.4-x86_64-bin-DVD1.iso Initializing download: http://url/iso/Centos/x86_64/CentOS-6.4-x86_64-bin-DVD1.iso File size: 4353378304 bytes Opening output file CentOS-6.4-x86_64-bin-DVD1.iso.0 Starting download [ 0%] .......... .......... .......... .......... .......... [ 382.3KB/s] [ 0%] .......... .......... .......... .......... .......... [ 610.9KB/s] [ 0%] .......... .......... .......... .......... .......... [ 826.5KB/s] [ 0%] .......... .......... .......... .......... .......... [1003.1KB/s] 略 [ 0%] .......... .......... .......... .......... .......... [2055.8KB/s] [ 0%] .......... .......... .......... .......... .......... [2074.8KB/s] [ 0%] .......... .......... .......... .......... .......... [2093.6KB/s] [ 0%] .......... .......... .......... .......... .......... [2111.0KB/s] [ 0%] .......... .......... .......... .......... ... Downloaded 2693.8 kilobytes in 1 second. (2113.05 KB/s) # rm -f CentOS-6.4-x86_64-bin-DVD1.iso*
# axel -n 10 http://url/iso/Centos/x86_64/CentOS-6.4-x86_64-bin-DVD1.iso Initializing download: http://url/iso/Centos/x86_64/CentOS-6.4-x86_64-bin-DVD1.iso File size: 4353378304 bytes Opening output file CentOS-6.4-x86_64-bin-DVD1.iso Starting download [ 0%] .......... .......... .......... .......... .......... [ 440.9KB/s] [ 0%] .......... .......... .......... .......... .......... [ 707.9KB/s] [ 0%] .......... .......... .......... .......... .......... [ 935.1KB/s] [ 0%] .......... .......... .......... .......... .......... [1138.8KB/s] [ 0%] .......... .......... .......... .......... .......... [1310.5KB/s] 略 [ 0%] .......... .......... .......... .......... .......... [2180.3KB/s] [ 0%] .......... .......... .......... .......... .......... [2196.9KB/s] [ 0%] .......... .......... .......... .......... .......... [2189.7KB/s] [ 0%] .......... .......... ......... Downloaded 4139.5 kilobytes in 1 second. (2176.65 KB/s)
# mytget http://url/iso/Centos/x86_64/CentOS-6.4-x86_64-bin-DVD1.iso Begin to download: CentOS-6.4-x86_64-bin-DVD1.iso Filesize: 4.1G 0% [ > > > ] [ 27M] [2.5M/s] [ETA:26:58]
# mytget -n 10 http://url/iso/Centos/x86_64/CentOS-6.4-x86_64-bin-DVD1.iso Begin to download: CentOS-6.4-x86_64-bin-DVD1.iso Filesize: 4.1G 0% [ > > > > > > > > > ] [ 39M] [2.6M/s] [ETA:26:27] # ll CentOS-6.4-x86_64-bin-DVD1.iso.mg\! -rw-r--r-- 1 root root 4353378404 Mar 11 12:53 CentOS-6.4-x86_64-bin-DVD1.iso.mg!
# axel -n 10 http://url/iso/Centos/x86_64/CentOS-6.4-x86_64-bin-DVD1.iso Initializing download: http://url/iso/Centos/x86_64/CentOS-6.4-x86_64-bin-DVD1.iso File size: 4353378304 bytes Opening output file CentOS-6.4-x86_64-bin-DVD1.iso Starting download [ 0%] .......... .......... .......... .......... .......... [ 491.8KB/s] [ 0%] .......... .......... .......... .......... .......... [ 748.4KB/s] [ 0%] .......... .......... .......... .......... .......... [1007.5KB/s] 略 [ 1%] .......... ........... .......... .......... .......... [2509.3KB/s] [ 1%] .......... .......... .......... .......... .......... [2509.5KB/s] [ 1%] .......... .......... .......... .... Downloaded 45.3 megabytes in 18 seconds. (2510.95 KB/s)
中止下載,進度已經到1%,下載了45.3mb
再次運行下載命令,繼續從1%斷點續傳
# axel -n 10 http://url/iso/Centos/x86_64/CentOS-6.4-x86_64-bin-DVD1.iso Initializing download: http://url/iso/Centos/x86_64/CentOS-6.4-x86_64-bin-DVD1.iso File size: 4353378304 bytes Opening output file CentOS-6.4-x86_64-bin-DVD1.iso State file found: 47549233 bytes downloaded, 4305829071 to go. Starting download ,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, ,,,,...... .......... [ 314.4KB/s] [ 1%] .......... .......... .......... .......... .......... [ 603.0KB/s] [ 1%] .......... .......... .......... .......... .......... [ 839.7KB/s] 略 [ 1%] .......... .......... .......... .......... .......... [1547.1KB/s] [ 1%] .......... .......... .......... .......... .......... [1548.8KB/s] # rm -f CentOS-6.4-x86_64-bin-DVD1.iso*
4.2 wget
# wget http://url/iso/Centos/x86_64/CentOS-6.4-x86_64-bin-DVD1.iso --2013-03-11 09:51:46-- http://url/iso/Centos/x86_64/CentOS-6.4-x86_64-bin-DVD1.iso Connecting to 10.0.251.154:80... connected. HTTP request sent, awaiting response... 200 OK Length: 4353378304 (4.1G) [application/octet-stream] Saving to: `CentOS-6.4-x86_64-bin-DVD1.iso' 1% [ ] 47,760,647 1.49M/s eta 47m 42s
wget在進度1%中止已經下載47,760,647,再次運行命令,重新開始下載
# wget http://url/iso/Centos/x86_64/CentOS-6.4-x86_64-bin-DVD1.iso --2013-03-11 09:53:24-- http://url/iso/Centos/x86_64/CentOS-6.4-x86_64-bin-DVD1.iso Connecting to 10.0.251.154:80... connected. HTTP request sent, awaiting response... 200 OK Length: 4353378304 (4.1G) [application/octet-stream] Saving to: `CentOS-6.4-x86_64-bin-DVD1.iso.1' 0% [ ] 1,032,445 1.21M/s
wget直接運行不支持斷點續傳
# rm -f CentOS-6.4-x86_64-bin-DVD1.iso*
wget重新測試使其支持斷點續傳
# wget http://url/iso/Centos/x86_64/CentOS-6.4-x86_64-bin-DVD1.iso --2013-03-11 12:40:15-- http://url/iso/Centos/x86_64/CentOS-6.4-x86_64-bin-DVD1.iso Connecting to 10.0.251.154:80... connected. HTTP request sent, awaiting response... 200 OK Length: 4353378304 (4.1G) [application/octet-stream] Saving to: `CentOS-6.4-x86_64-bin-DVD1.iso' 1% [> ] 52,620,206 1.57M/s eta 44m 58s
在進度1%,已經下載52,620,206處停止
wget 加-c再次下載,支持斷點續傳
# wget -c http://url/iso/Centos/x86_64/CentOS-6.4-x86_64-bin-DVD1.iso --2013-03-11 12:40:56-- http://url/iso/Centos/x86_64/CentOS-6.4-x86_64-bin-DVD1.iso Connecting to 10.0.251.154:80... connected. HTTP request sent, awaiting response... 206 Partial Content Length: 4353378304 (4.1G), 4300661972 (4.0G) remaining [application/octet-stream] Saving to: `CentOS-6.4-x86_64-bin-DVD1.iso' 1% [+ ] 59,663,080 1.59M/s eta 44m 14s # rm -f CentOS-6.4-x86_64-bin-DVD1.iso.mg\!
4.3 myget
# mytget http://url/iso/Centos/x86_64/CentOS-6.4-x86_64-bin-DVD1.iso Begin to download: CentOS-6.4-x86_64-bin-DVD1.iso Filesize: 4.1G 1% [ > > > ] [ 45M] [2.1M/s] [ETA:33:06]
下載進度到1% 文件大小45M
# ll CentOS-6.4-x86_64-bin-DVD1.iso.mg\! -rw-r--r-- 1 root root 4353378404 Mar 11 12:54 CentOS-6.4-x86_64-bin-DVD1.iso.mg!
再次執行命令,直接從進度1%開始下載
# mytget http://url/iso/Centos/x86_64/CentOS-6.4-x86_64-bin-DVD1.iso Begin to download: CentOS-6.4-x86_64-bin-DVD1.iso Filesize: 4.1G 1% [ > > > ] [ 51M] [2.9M/s] [ETA:23:57]
斷點續傳對比,三個工具都支持,但wget需要增加-c參數,axel、myget再次執行命令即可。