linux命令行下载文件以及常用工具:wget、Prozilla、MyGet、Linuxdown、Curl、Axel @ aria2 & wget (***)

久经考验的 wget  Linux网络命令:可以断点续传的网络下载工具wget详解_linux断点续传工具-CSDN博客 

aria2 说明

  • 虽然 aria2 的命令很多,很复杂。
  • 但是,常用的那几个命令,其实也很简单。

aria2 & aria2c

  • aria2c(c 可能表示 "client"?  cli ? Linux CLI 是 "Command Line Interface" 的缩写,中文意思是命令行界面‌。),但为符合 Unix 命名惯例(去后缀),多数 Linux 发行版会创建 aria2 符号链接。这种行为与以下工具类似:
  • gzip → gunzip(同一工具的不同模式)
  • python → python3(版本别名)

aria2 常用命令

# Download from WEB:
aria2c http://example.org/mylinux.iso
 
# Download from 2 sources:
$ aria2c http://a/f.iso ftp://b/f.iso
 
# Download using 2 connections per host:
$ aria2c -x2 http://a/f.iso

​# aria2 常用命令
sudo apt install aria2

## Usage Examples
# Command-line scares you off? No, aria2 is really easy to use!!

# Download from WEB:
aria2c http://example.org/mylinux.iso

# Download from 2 sources:
$ aria2c http://a/f.iso ftp://b/f.iso

# Download using 2 connections per host:
$ aria2c -x2 http://a/f.iso

# BitTorrent:
aria2c http://example.org/mylinux.torrent

# BitTorrent Magnet URI:
aria2c 'magnet:?xt=urn:btih:248D0A1CD08284299DE78D5C1ED359BB46717D8C'

# Metalink:
aria2c http://example.org/mylinux.metalink

# Download URIs found in text file:
aria2c -i uris.txt

$ aria2c -h

 -c, --continue[=true|false]  Continue downloading a partially downloaded
                              file. Use this option to resume a download
                              started by a web browser or another program
                              which downloads files sequentially from the
                              beginning. Currently this option is only
                              applicable to http(s)/ftp downloads.

                              Possible Values: true, false
                              Default: false
                              Tags: #basic, #http, #ftp

 

aria2c -c 完整命令的例子

aria2的-c选项用于断点续传,即在下载被中断时,可以从上次停止的地方继续下载。以下是一些使用aria2和-c选项的完整命令例子:

1. 单个文件断点续传‌:

aria2c -c http://example.com/file.zip 

这个命令会从http://example.com/file.zip下载文件,并在下载被中断后,使用-c选项从上次停止的地方继续下载。

2. 指定文件名和断点续传‌:

aria2c -c -o myfile.zip http://example.com/file.zip 

这个命令除了断点续传外,还使用-o选项将下载的文件重命名为myfile.zip

3. 多线程下载和断点续传‌:

aria2c -c -x 4 http://example.com/largefile.zip 

这个命令使用-x选项指定4个线程来加速下载,并在下载中断后,使用-c选项从上次停止的地方继续下载。

4. 限制下载速度和断点续传

aria2c -c --max-download-limit=500K http://example.com/file.zip

这个命令在断点续传的同时,使用--max-download-limit选项将下载速度限制为500KB/s。

5. 从FTP服务器断点续传‌:

aria2c -c ftp://example.com/file.zip

这个命令会从FTP服务器上的ftp://example.com/file.zip下载文件,并在下载被中断后,使用-c选项从上次停止的地方继续下载。

请注意,这些例子中的URL(如http://example.com/file.zip)应替换为实际的文件下载链接。此外,aria2还支持许多其他选项和功能,可以根据需要进行组合使用。

以上信息基于aria2的官方文档和常见用法,具体命令和选项可能会因aria2的版本不同而有所差异。建议查阅aria2的官方文档或使用aria2c --help命令获取最准确的信息。

## axel

sudo apt update
sudo apt install axel

# 使用8个连接
axel -n 8 http://example.com/file.zip

# 将下载速度限制为 500 KB/s
axel -s 500k http://example.com/file.zip

# 断点续传
axel -c http://example.com/file.zip

axel   GitHub - axel-download-accelerator/axel: Lightweight CLI download accelerator 

aria2  GitHub - aria2/aria2: aria2 is a lightweight multi-protocol & multi-source, cross platform download utility operated in command-line. It supports HTTP/HTTPS, FTP, SFTP, BitTorrent and Metalink. 

  分享|aria2 与 wget :选择你的下载管理器 

**  linux的wget下载大文件技巧 - 问答 - 亿速云 

  【Linux】多线程下载加速神器Axel:如何使用axel命令高效快速下载文件,支持断点续传、设置用户代理(--user-agent)、设置请求头(--header)、设置HTTP代理、限制下载速度等_I_am_Alex的技术博客_51CTO博客 

  Linux下常用下载工具比较:wget、curl、axel与aria2 - 极简博客 

结论

wget、curl、axel和aria2都是常用的Linux下载工具,它们各自有着不同的特点和适用场景。

  • 如果只是简单的文件下载,可以使用wget或curl。
  • 如果需要加速下载速度,可以尝试使用axel。
  • 而aria2则是功能最为丰富的下载工具,可以满足更多高级需求。

根据自己的需求选择合适的下载工具,可以提高下载效率和体验。

***  wget、axel、aria2区别与用法 - lisenMiller - 博客园 

首先区别是:

wget、axel和aria2都是在命令行下使用的下载工具,但它们在功能和特性上有一些区别。

wget是最基础的命令行下载工具,它支持HTTP、HTTPS和FTP协议,并且可以在慢速或不稳定的网络连接下保持健壮性。如果下载过程中发生网络问题,wget会尝试重新下载,直到整个文件下载完成。此外,wget对于简单的下载任务来说非常实用,只需要输入简单的命令就可以完成。

axel是一个轻量级的下载加速器,它支持HTTP、HTTPS、FTP和FTPS协议。Axel通过为文件打开多个连接并下载单独的文件片段来加速下载过程,这可以使下载速度提高多达40%。此外,它也可以使用多个镜像站点来下载单个文件。

aria2是一个功能强大且速度更快的下载工具,它支持多种协议和下载方式,包括HTTP/HTTPS、FTP/SFTP、BitTorrent和Metalink。aria2的一个突出特性是支持从多个位置同时下载文件,这对于提高下载速度非常有帮助。此外,aria2还包含了一个功能齐全的BitTorrent客户端,支持DHT、PEX、加密、磁铁URI、网络种子、选择性下载和本地对等发现等特性。然而,aria2的使用需要较复杂的命令语法,对于不熟悉命令行操作的用户来说可能有一定的学习难度。

综上所述,wget、axel和aria2在功能和特性上各有优势。

  • 对于简单的下载任务,wget可能更加简单和实用;
  • 对于需要加速的下载任务,axel可能是一个不错的选择;
  • 而对于需要更多高级功能和协议支持的下载任务,aria2可能是更好的选择。

   

Linux下什么下载工具比较好?aria2 与 axel 比较

axel 啊。 aria2 不好调参数,有2个参数互相影响,要达到最大速度很麻烦。axel 直接 -n 8/100 都可以,不要想多余的。  https://www.zhihu.com/question/20082724/answer/13916204 

aria2

The next generation download utility.

   aria2 

aria2 is a lightweight multi-protocol & multi-source command-line download utility. It supports HTTP/HTTPS, FTP, SFTP, BitTorrent and Metalink. aria2 can be manipulated via built-in JSON-RPC and XML-RPC interfaces.

Download

Download version 1.37.0. There you can download source distribution and binaries for OS X, Windows and Android.

The legacy releases earlier than 1.19.1 are available here.

Features

  • Multi-Connection Download. aria2 can download a file from multiple sources/protocols and tries to utilize your maximum download bandwidth. Really speeds up your download experience.

  • Lightweight. aria2 doesn’t require much memory and CPU time. When disk cache is off, the physical memory usage is typically 4MiB (normal HTTP/FTP downloads) to 9MiB (BitTorrent downloads). CPU usage in BitTorrent with download speed of 2.8MiB/sec is around 6%.

  • Fully Featured BitTorrent Client. All features you want in BitTorrent client are available: DHT, PEX, Encryption, Magnet URI, Web-Seeding, Selective Downloads, Local Peer Discovery and UDP tracker.

  • Metalink Enabled. aria2 supports The Metalink Download Description Format (aka Metalink v4), Metalink version 3 and Metalink/HTTP. Metalink offers the file verification, HTTP/FTP/SFTP/BitTorrent integration and the various configurations for language, location, OS, etc.

  • Remote Control. aria2 supports RPC interface to control the aria2 process. The supported interfaces are JSON-RPC (over HTTP and WebSocket) and XML-RPC.

Usage Examples

Command-line scares you off? No, aria2 is really easy to use!!

Download from WEB:

$ aria2c http://example.org/mylinux.iso

Download from 2 sources:

$ aria2c http://a/f.iso ftp://b/f.iso

Download using 2 connections per host:

$ aria2c -x2 http://a/f.iso

BitTorrent:

$ aria2c http://example.org/mylinux.torrent

BitTorrent Magnet URI:

$ aria2c 'magnet:?xt=urn:btih:248D0A1CD08284299DE78D5C1ED359BB46717D8C'

Metalink:

$ aria2c http://example.org/mylinux.metalink

Download URIs found in text file:

$ aria2c -i uris.txt

Related Projects

  • apt-metalink: Faster package downloads for Debian/Ubuntu
  • powerpill: Pacman wrapper for parallel and segmented downloads.
  • python3-aria2jsonrpc: A wrapper class around Aria2’s JSON RPC interface.
  • aria2.js: JavaScript (browsers and Node.js) library and cli for aria2 RPC

UI Frontends

  • webui-aria2: Web browser interface for aria2 (2012 GSOC project)
  • uGet: the Linux Download Manager

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Linux axel 下载加速命令详解

简介

axel 命令是一个轻量级、快速且用户友好的 Linux 命令行下载加速器。它通过将文件分割成片段并同时下载来加快下载速度,这对于大文件和网络不好时尤其有用。

axel 支持 HTTP、HTTPS、FTP 和 FTPS 协议。

安装

Debian/Ubuntu

sudo apt update
sudo apt install axel

    CentOS/RHEL

sudo yum install axel

    Fedora

sudo dnf install axel

    MacOS

brew install axel

关键特性

  •     并行连接:将文件分成几部分并同时下载
  •     断点续传:恢复中断的下载
  •     简单而最小的输出:为提高效率而设计

常用选项

    --max-speed, -s:指定最大下载速度

    --num-connections, -n:指定连接数

    --output, -o:指定输出的文件名称

    --no-proxy, -N:不使用代理服务器

    --verbose, -v:显示更多状态信息

    --quiet, -q:安静模式,最小化输出

    --alternate, -a:显示一个可选的进度条

    --header, -H:添加额外的 HTTP 标头

    --help, -h:打印帮助信息

    --version, -V:打印版本信息

示例用法

使用多个连接下载(默认值:4)

axel -n 8 http://example.com/file.zip

# 使用8个连接

指定输出的文件名

axel -o custom_name.zip http://example.com/file.zip

断点续传

axel -c http://example.com/file.zip

限制下载速度

axel -s 500k http://example.com/file.zip

# 将下载速度限制为 500 KB/s

设置重试次数

axel -r 3 http://example.com/file.zip

安静模式

axel -q http://example.com/file.zip

# 最小化输出信息

调试模式

axel -v http://example.com/file.zip

# 输出更多调试信息

使用代理服务器

axel -x http://proxy_server:port http://example.com/file.zip

设置用户代理

axel -U "Mozilla/5.0" http://example.com/file.zip

指定可选的镜像

axel -a http://mirror1.com/file.zip http://mirror2.com/file.zip

配置文件示例

配置文件在 /etc/axelrc 或 ~/.axelrc

# 重连延迟
reconnect_delay = 20

# 最大下载速度
max_speed = 500000

# 同时下载的连接数
num_connections = 4

# 连接超时时间
connection_timeout = 30

# 一次从所有当前连接读取的最大数量
buffer_size = 10240

# 输出更多信息
verbose = 1

# 默认下载目录
default_directory = /downloads

# 代理服务器
http_proxy=127.0.0.1

# 重连延迟
reconnect_delay = 20

# 最大下载速度
max_speed = 500000

# 同时下载的连接数
num_connections = 4

# 连接超时时间
connection_timeout = 30

# 一次从所有当前连接读取的最大数量
buffer_size = 10240

# 输出更多信息
verbose = 1

# 默认下载目录
default_directory = /downloads

# 代理服务器
http_proxy=127.0.0.1

原文链接:https://blog.csdn.net/tangPHP/article/details/144777717

在 Linux 上使用多线程下载文件,你可以使用工具如 aria2 或 wget 来实现

1. 使用 aria2 进行多线程下载

aria2 是一个轻量级的多线程下载工具,支持 HTTP、FTP 和其他协议,适合用来进行多线程下载。

安装 aria2:

在终端中执行以下命令安装 aria2:

sudo apt-get install aria2

使用 aria2 进行多线程下载:

使用 aria2c 命令下载文件,并指定线程数量。你可以通过 -x 选项来指定并发连接数(线程数)。

aria2c -x 16 https://developer.nvidia.com/compute/cudnn/secure/8.6.0/local_installers/11.8/cudnn-linux-x86_64-8.6.0.163_cuda11-archive.tar.xz

上面的命令将使用 16 个并发连接下载文件。你可以根据网络状况调整线程数。

2. 使用 wget(不支持多线程)

虽然 wget 是非常常用的下载工具,但它并不支持多线程下载。你可以使用 wget 进行下载,但下载速度可能比 aria2 稍慢:

wget https://developer.nvidia.com/compute/cudnn/secure/8.6.0/local_installers/11.8/cudnn-linux-x86_64-8.6.0.163_cuda11-archive.tar.xz

3. 使用 curl 进行分段下载并合并(模拟多线程)

虽然 curl 也不支持多线程,但可以通过分段下载的方式来模拟多线程操作。以下是一个简单示例:

# 使用 curl 分段下载文件的不同部分
curl -o part1 -r 0-50000000 https://developer.nvidia.com/compute/cudnn/secure/8.6.0/local_installers/11.8/cudnn-linux-x86_64-8.6.0.163_cuda11-archive.tar.xz
curl -o part2 -r 50000001-100000000 https://developer.nvidia.com/compute/cudnn/secure/8.6.0/local_installers/11.8/cudnn-linux-x86_64-8.6.0.163_cuda11-archive.tar.xz

# 合并文件
cat part1 part2 > cudnn-linux-x86_64-8.6.0.163_cuda11-archive.tar.xz

但这种方法需要你手动计算分段大小,并且不是非常方便。

总结:

最推荐使用的是 aria2,它是一个轻量且支持多线程下载的工具,能够极大加快下载速度。

原文链接:https://blog.csdn.net/peng0614/article/details/142979620

linux wget 可以多线程 下载吗?

  百度一下,你就知道 

wget在Linux系统中不支持多线程下载‌。wget是一个非常强大的命令行下载工具,但它主要是单线程下载工具,不支持多线程下载‌1。尽管wget支持断点续传、限制下载速度等功能,但它本身并不支持同时从多个源下载或同时下载文件的多个部分‌。

如果你需要使用多线程下载,可以考虑使用其他工具,如:

  1. axel‌:这是一个轻量级的命令行下载工具,支持多线程下载,能够显著提高下载速度‌。
  2. aria2‌:这是一个功能强大的命令行下载工具,支持多线程下载、断点续传、BitTorrent协议等‌。
  3. curl‌:虽然curl本身不支持多线程下载,但可以通过一些技巧实现类似效果,例如通过指定多个起始位置和结束位置来模拟多线程下载‌。

linux 下载工具:axel‌ 与 aria2‌ 比较,哪一个更好?

Aria2Axel各有优缺点,选择哪一个更好取决于具体需求和使用场景。

Aria2

Aria2是一个轻量级的下载管理器,支持多种协议和多源下载。它可以通过命令行界面操作,支持HTTP/HTTPS、FTP、SFTP、BitTorrent和Metalink等多种协议。Aria2的主要特点包括:

  • 多线程下载‌:Aria2支持多线程下载,可以使用多个源或协议下载文件,从而加速下载过程。
  • 轻量级‌:Aria2不需要太多的内存和CPU资源,适合长时间运行的任务。
  • 功能丰富‌:支持分段下载、选择性下载、限制下载/上传速度等功能‌。

Axel

Axel是一个轻量级的下载程序,支持HTTP、HTTPS、FTP和FTPS协议。它通过多线程下载来显著提升下载速度。Axel的主要特点包括:

  • 简单易用‌:操作简单,用户只需在命令行中指定URL和输出目录即可开始下载。
  • 默认多线程‌:Axel默认使用16个线程进行下载,用户可以自行调整线程数量以适应不同的网络环境。
  • 资源占用少‌:由于没有依赖,使用非常少的CPU和内存‌。

适用场景

  • Aria2‌:适合需要高效下载大量文件大文件的场景,特别是那些需要支持多种协议和高级功能的用户。Aria2的多线程和分段下载功能使其在网络条件不稳定时也能保持较高的下载速度和效率。
  • Axel‌:适合需要快速下载单个少量文件的用户,特别是那些对资源占用有严格要求的场景。Axel的简单易用和多线程特性使其在需要快速完成下载任务时表现出色。

Linux命令行多线程、断点续传下载工具

2017-11  Linux命令行多线程、断点续传下载工具-阿里云开发者社区 

简介:

#####################################################
## 如有转载,请务必保留本文链接及版权信息
## linux/unix网站运维技术!
##QQ:335623998
##E-mail:335623998@qq.com
#####################################################
   
运维工作中常会在linux命令行下载外网文件或内网进行大文件传输,经常使用的文本下载工具wget、curl,今天给大家推荐支持Linux命令行多线程、断点续传下载工具axel和myget。
 
1、系统环境
# 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
2、下载工具安装、使用方法介绍
2.1 wget
CentOS  默认已经安装,如需安装请运行
# yum install wget -y
wget 版本信息
# wget -V
GNU Wget 1.11.4 Red Hat modified
此工具比较常用,使用方法、参数略
2.2 Axel 下载 安装
 
源码包地址
http://alioth.debian.org/frs/?group_id=100070
最新版本axel-2.4源码包下载地址
http://alioth.debian.org/frs/download.php/3015/axel-2.4.tar.gz
rpm 包地址
http://pkgs.repoforge.org/axel/
选择下载对应系统的rpm包
# wget http://pkgs.repoforge.org/axel/axel-2.4-1.el5.rf.x86_64.rpm
安装axel
# rpm -ivh axel-2.4-1.el5.rf.x86_64.rpm
axel 版本
# axel -V
Axel version 2.4 (Linux)
axel 命令使用方法:
axel [ 选项参数] url1 [url2] [url……]
axel  参数:
--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
2.3 myget 下载、安装
[root@cobbler-1014 ~]# wget http://myget.sourceforge.net/release/myget-0.1.2.tar.gz
[root@cobbler-1014 ~]# tar zxf myget-0.1.2.tar.gz
[root@cobbler-1014 ~]# cd myget-0.1.2
# ./configure && make && make install

mytget版本,注意myget命令为mytget

# mytget -v

myget 0.1.1

命令mytget用法
mytget [ 选项] [url]
参数
 -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]  # 设置代理
3、wget、axel、myget测试下载速度对比
3.1 下载速度对比
说明:同一台机器下载同一个数据源链接
3.1.1 wget下载
# 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
3.2 axel下载
# 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*
3.2.1 axel  使用10个线程下载
# 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)
3.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
 0% [                       >                       >                       >                         ] [ 27M] [2.5M/s] [ETA:26:58]
3.3.1 myget指定10个线程下载
# 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、myget支持多线程,且速度较快都在2M。
 
4 、断点续传对比测试
4.1 axel
# 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再次执行命令即可。
综上对比推荐大家工作中使用axel或myget提高效率,个人比较喜欢axel。
注意内网传输根据隧道带宽进行限速,别影响线上生产服务数据传输。


 

aria2 与 aria2c 的区别

  DeepSeek 

aria2aria2c 本质上是同一个工具的不同名称,没有功能区别。以下是详细说明:


核心结论

  • aria2caria2 的可执行文件(二进制程序)的默认名称。

  • aria2 通常作为命令别名或符号链接指向 aria2c

  • 两者完全等同,具体使用哪个取决于系统环境和安装方式。


区别详解

对比项aria2aria2c
本质通常为符号链接或别名实际二进制文件名
调用方式依赖系统环境配置直接执行二进制文件
典型场景多数Linux发行版的默认命令名macOS/Windows 安装包常用名称
验证方法which aria2 → 查看指向路径which aria2c → 查看真实二进制路径

验证示例

bash

Copy

# 在 Linux 系统中检查(通常两者指向同一文件)
$ ls -l /usr/bin/aria2
lrwxrwxrwx 1 root root 5 Mar 10  2023 /usr/bin/aria2 -> aria2c

# 查看帮助文档(完全一致)
$ aria2 --help
$ aria2c --help

# 检查版本信息(输出相同)
$ aria2 -v
aria2 version 1.36.0
$ aria2c -v
aria2 version 1.36.0

使用建议

  1. 优先使用 aria2
    多数文档和社区教程默认使用此名称:

    bash

    Copy

    aria2 -x 16 http://example.com/file.iso
  2. 特殊情况下使用 aria2c
    当系统未配置符号链接时(如某些Windows环境):

    cmd

    Copy

    aria2c.exe -s 8 ftp://example.com/file.zip
  3. 兼容性处理
    若遇到脚本兼容性问题,可手动创建符号链接:

    bash

    Copy

    sudo ln -s /usr/bin/aria2c /usr/local/bin/aria2

常见误区

  • ❌ "aria2 是新一代工具,aria2c 是旧版"
    → 二者始终同步更新,版本完全一致。

  • ❌ "aria2 支持更多协议"
    → 协议支持由编译选项决定,与命令名称无关。

  • ❌ "Windows 必须用 aria2c.exe"
    → 可重命名文件为 aria2.exe,功能不变。


底层原理

编译后的二进制文件默认命名为 aria2cc 可能表示 "client"),但为符合 Unix 命名惯例(去后缀),多数 Linux 发行版会创建 aria2 符号链接。这种行为与以下工具类似:

  • gzipgunzip(同一工具的不同模式)

  • pythonpython3(版本别名)


若仍有疑问,可通过检查文件哈希值确认二者是否相同:

md5sum /usr/bin/aria2 /usr/bin/aria2c
# 输出相同哈希值即证明为同一文件
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值