Axel 是一个轻量级下载程序,它和其他加速器一样,对同一个文件建立多个连接,每个连接下载单独的文件片段以更快地完成下载。

Axel 支持 HTTP、HTTPS、FTP 和 FTPS 协议。它也可以使用多个镜像站点下载单个文件,所以,Axel 可以加速下载高达 40%(大约,我个人认为)。它非常轻量级,因为它没有依赖并且使用非常少的 CPU 和内存。

Axel 一步到位地将所有数据直接下载到目标文件(LCTT 译注:而不是像其它的下载软件那样下载成多个文件块,然后拼接)。

注意:不支持在单条命令中下载两个文件。

你还可以尝试其他命令行下载管理器/加速器。

大多数发行版(Debian、Ubuntu、Mint、Fedora、suse、openSUSE、Arch Linux、Manjaro、Mageia 等)都有 axel 包,所以我们可以从发行版官方仓库轻松安装。对于 CentOS/RHEL,我们需要启用 EPEL Repository

  1. [在 Debian/Ubuntu/LinuxMint 上安装 Axel]
  2. $ sudo apt-get install axel
  3. [在 RHEL/CentOS 上安装 Axel]
  4. $ sudo yum install axel
  5. [在 Fedora 上安装 Axel]
  6. $ sudo dnf install axel
  7. [在 openSUSE 上安装 Axel]
  8. $ sudo zypper install axel
  9. [在 Mageia 上安装 Axel]
  10. $ sudo urpmi axel
  11. [在基于 Arch Linux 的发行版安装 Axel]
  12. $ sudo pacman -S axel

1) 下载单个文件

以下命令将从给定的 URL 下载文件并存储在当前目录中,下载文件时,我们可以看到文件的信息(建立的连接数、下载速度、下载进度、完成下载所花费的时间以及连接完成的时间)。

  1. # axel https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
  2. Initializing download: https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
  3. File size: 22678208 bytes
  4. Opening output file owncloud-9.0.0.tar.bz2
  5. Starting download
  6. [ 0%] .......... .......... .......... .......... .......... [ 146.7KB/s]
  7. [ 0%] .......... .......... .......... .......... .......... [ 267.0KB/s]
  8. [ 0%] .......... .......... .......... .......... .......... [ 373.9KB/s]
  9. [ 0%] .......... .......... .......... .......... .......... [ 406.9KB/s]
  10. [ 0%] .......... .......... .......... .......... .......... [ 487.5KB/s]
  11. [ 1%] .......... .......... .......... .......... .......... [ 572.6KB/s]
  12. [ 1%] .......... .......... .......... .......... .......... [ 650.7KB/s]
  13. [ 1%] .......... .......... .......... .......... .......... [ 649.3KB/s]
  14. [ 1%] .......... .......... .......... .......... .......... [ 718.1KB/s]
  15. [ 2%] .......... .......... .......... .......... .......... [ 769.3KB/s]
  16. [ 2%] .......... .......... .......... .......... .......... [ 838.7KB/s]
  17. [ 2%] .......... .......... .......... .......... .......... [ 866.0KB/s]
  18. Connection 0 finished
  19. .
  20. .
  21. [ 99%] .......... .......... .......... .......... .......... [5721.0KB/s]
  22. Connection 2 finished
  23. [ 99%] .......... .......... .......... .......... .......... [5733.4KB/s]
  24. Connection 1 finished
  25. [ 99%] .......... .......... .......... .......... .......... [5745.4KB/s]
  26. [100%] .......... .......... .......... .......... ......
  27. Downloaded 21.6 megabytes in 3 seconds. (5755.94 KB/s)

2) 用不同的名称保存文件

要使用其他名称来保存文件,启动下载时可以添加 -o(小写字母)选项和文件名。这里我们使用文件名 owncloud.tar.bz2 来保存文件。

  1. # axel -o cloud.tar.bz2 https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
  2. Initializing download: https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
  3. File size: 22678208 bytes
  4. Opening output file cloud.tar.bz2
  5. Starting download
  6. [ 0%] .......... .......... .......... .......... .......... [ 143.0KB/s]
  7. [ 0%] .......... .......... .......... .......... .......... [ 264.1KB/s]
  8. [ 0%] .......... .......... .......... .......... .......... [ 309.8KB/s]
  9. [ 0%] .......... .......... .......... .......... .......... [ 406.3KB/s]
  10. [ 0%] .......... .......... .......... .......... .......... [ 495.4KB/s]
  11. [ 1%] .......... .......... .......... .......... .......... [ 586.3KB/s]
  12. [ 1%] .......... .......... .......... .......... .......... [ 673.1KB/s]
  13. [ 1%] .......... .......... .......... .......... .......... [ 647.1KB/s]
  14. [ 1%] .......... .......... .......... .......... .......... [ 721.1KB/s]
  15. [ 2%] .......... .......... .......... .......... .......... [ 781.3KB/s]
  16. Connection 2 finished
  17. .
  18. .
  19. Connection 0 finished
  20. [ 98%] .......... .......... .......... .......... .......... [6221.9KB/s]
  21. [ 98%] .......... .......... .....
  22. Connection 1 finished
  23. ,,,,,,,,,, ,,,,,,,,,, ,,,,,..... .......... .......... [6145.6KB/s]
  24. [ 99%] .......... .......... .......... .......... .......... [6159.2KB/s]
  25. [ 99%] .......... .......... .......... .......... .......... [6172.0KB/s]
  26. [ 99%] .......... .......... .......... .......... .......... [5977.9KB/s]
  27. [ 99%] .......... .......... .......... .......... .......... [5989.6KB/s]
  28. [100%] .......... .......... .......... .......... ......
  29. Downloaded 21.6 megabytes in 3 seconds. (6001.05 KB/s)

3) 限制下载速度

默认情况下 axel 以字节/秒为单位设置下载文件的最大速度。当我们的网络连接速度较慢时,可以使用此选项。只需添加 -s 选项,后面跟字节值。这里我们要限速 512 KB/s 下载一个文件。

  1. # axel -s 512000 https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
  2. Initializing download: https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
  3. File size: 22678208 bytes
  4. Opening output file owncloud-9.0.0.tar.bz2
  5. Starting download
  6. [ 0%] .......... .......... .......... .......... .......... [ 141.5KB/s]
  7. [ 0%] .......... .......... .......... .......... .......... [ 266.1KB/s]
  8. [ 0%] .......... .......... .......... .......... .......... [ 308.0KB/s]
  9. [ 0%] .......... .......... .......... .......... .......... [ 405.9KB/s]
  10. [ 0%] .......... .......... .......... .......... .......... [ 496.7KB/s]
  11. [ 1%] .......... .......... .......... .......... .......... [ 526.4KB/s]
  12. [ 1%] .......... .......... .......... .......... .......... [ 507.0KB/s]
  13. [ 1%] .......... .......... .......... .......... .......... [ 505.6KB/s]
  14. [ 1%] .......... .......... .......... .......... .......... [ 504.8KB/s]
  15. [ 2%] .......... .......... .......... .......... .......... [ 503.9KB/s]
  16. [ 2%] .......... .......... .......... .......... .......... [ 503.4KB/s]
  17. .
  18. .
  19. [ 99%] .......... .......... .......... .......... .......... [ 497.0KB/s]
  20. [ 99%] .......... .......... .......... .......... .......... [ 496.9KB/s]
  21. [100%] .......... ..
  22. Connection 0 finished
  23. ,,,,,,,,,, ,,.....
  24. Connection 1 finished
  25. Connection 3 finished
  26. ,,,,,,,,,, ,,,,,,,... .......... .......... ......
  27. Downloaded 21.6 megabytes in 44 seconds. (494.54 KB/s)

4) 限制连接数

axel 默认建立 4 个连接以从不同的镜像获取文件。此外,我们可以通过使用 -n 选项添加更多的连接,后跟连接数 10 来提高下载速度。保险起见,我们添加了十个连接,但不幸的是,它花了更多时间来下载文件。

  1. # axel -n 10 https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
  2. Initializing download: https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
  3. File size: 22678208 bytes
  4. Opening output file owncloud-9.0.0.tar.bz2
  5. Starting download
  6. [ 0%] .......... .......... .......... .......... .......... [ 140.8KB/s]
  7. [ 0%] .......... .......... .......... .......... .......... [ 265.7KB/s]
  8. [ 0%] .......... .......... .......... .......... .......... [ 305.4KB/s]
  9. [ 0%] .......... .......... .......... .......... .......... [ 402.1KB/s]
  10. [ 0%] .......... .......... .......... .......... .......... [ 496.3KB/s]
  11. [ 1%] .......... .......... .......... .......... .......... [ 522.1KB/s]
  12. [ 1%] .......... .......... .......... .......... .......... [ 567.5KB/s]
  13. [ 1%] .......... .......... .......... .......... .......... [ 640.5KB/s]
  14. [ 1%] .......... .......... .......... .......... .......... [ 710.8KB/s]
  15. [ 2%] .......... .......... .......... .......... .......... [ 780.5KB/s]
  16. .
  17. .
  18. [ 98%] .......... .......... .......... .......... .......... [7544.9KB/s]
  19. [ 98%] .......... .......... .......... .......... .......... [7557.9KB/s]
  20. [ 98%] .......... .......... .......... .......... .......... [7570.4KB/s]
  21. [ 98%] .......... .......... .......... .......... .......... [7495.3KB/s]
  22. [ 99%] .......... .......... .......... .......... ......
  23. Connection 2 finished
  24. ,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, ,,,,,,.... [7311.6KB/s]
  25. [ 99%] .......... .......... .......... .......... .......... [7318.9KB/s]
  26. [ 99%] .......... .......... .......... .......... ..........
  27. Connection 9 finished
  28. ,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, [7331.0KB/s]
  29. [ 99%] .......... .......... .......... ..........
  30. Connection 3 finished
  31. ,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, .......... [4300.7KB/s]
  32. [100%] .......... .......... .......... .......... ......
  33. Downloaded 21.6 megabytes in 5 seconds. (4109.41 KB/s)

5) 恢复未完成的下载

axel 默认具有恢复未完成的下载的行为。Axel 在下载文件时定期更新状态文件(扩展名为 .st)。由于某些原因,下载中途停止了?不用担心,只要使用相同的 axel 命令,它将会检查 file 和 file.st,如果找到,它会从停止处恢复下载。

  1. # axel https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
  2. Initializing download: https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
  3. File size: 22678208 bytes
  4. Opening output file owncloud-9.0.0.tar.bz2
  5. Starting download
  6. [ 0%] .......... .......... .......... .......... .......... [ 140.8KB/s]
  7. [ 0%] .......... .......... .......... .......... .......... [ 265.7KB/s]
  8. [ 0%] .......... .......... .......... .......... .......... [ 305.4KB/s]
  9. [ 0%] .......... .......... .......... .......... .......... [ 402.1KB/s]
  10. [ 0%] .......... .......... .......... .......... .......... [ 496.3KB/s]
  11. [ 1%] .......... .......... .......... .......... .......... [ 522.1KB/s]
  12. [ 1%] .......... .......... .......... .......... .......... [ 567.5KB/s]
  13. [ 1%] .......... .......... .......... .......... .......... [ 640.5KB/s]
  14. [ 1%] .......... .......... .......... .......... .......... [ 710.8KB/s]
  15. [ 2%] .......... .......... .......... .......... .......... [ 780.5KB/s]
  16. .
  17. .
  18. [ 84%] .......... .......... .......... .......... .......... [7100.7KB/s]
  19. [ 84%] .......... .......... .......... .......... .......... [7104.3KB/s]
  20. [ 84%] .......... .......... .......... .^C
  21. Downloaded 18.3 megabytes in 2 seconds. (7009.79 KB/s)

上面的输出清晰地显示了在下载断开时有两个文件 owncloud-9.0.0.tar.bz2 和 owncloud-9.0.0.tar.bz2.st。当重新开始下载时,它会从停止处开始下载。

  1. # ls -lh
  2. total 19M
  3. -rw------- 1 root root 22M Dec 27 08:33 owncloud-9.0.0.tar.bz2
  4. -rw------- 1 root root 44 Dec 27 08:33 owncloud-9.0.0.tar.bz2.st
  5. # axel https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
  6. Initializing download: https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
  7. File size: 22678208 bytes
  8. Opening output file owncloud-9.0.0.tar.bz2
  9. State file found: 19180828 bytes downloaded, 3497380 to go.
  10. Starting download
  11. ,,,,,,,,,, ,,,,,,,,,, ,,,,,,,,,, ,......... .......... [ 66.5KB/s]
  12. [ 84%] .......... .......... .......... .......... .......... [ 186.0KB/s]
  13. [ 85%] .......... .......... .......... .......... .......... [ 241.7KB/s]
  14. [ 85%] .......... .......... .......... .......... .......... [ 335.6KB/s]
  15. [ 85%] .......... .......... .......... .......... .......... [ 351.5KB/s]
  16. [ 85%] .......... .......... .......... .......... .......... [ 427.1KB/s]
  17. [ 85%] .......... .......... .......... .......... .......... [ 427.4KB/s]
  18. [ 86%] .......... .......... .......... .......... .......... [ 491.5KB/s]
  19. .
  20. .
  21. [ 98%] ...
  22. Connection 0 finished
  23. ,,,....... .......... .......... .......... .......... [2106.6KB/s]
  24. [ 99%] .......... .......... .......... .......... .......... [2140.5KB/s]
  25. [ 99%] .......... .......... .......... .......... .......... [2172.4KB/s]
  26. [ 99%] .......... .......... .......... .......... .......... [2203.2KB/s]
  27. [ 99%] .......... .......... .......... .......... .......... [2236.2KB/s]
  28. [100%] .......... .......... .......... .......... ......
  29. Downloaded 3415.4 kilobytes in 1 second. (2264.93 KB/s)

6) 不显示文件下载进度

如果你不想要看到文件的下载进度,只要在 axel 命令中加入 -q 选项。

  1. # axel -q https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2

7) 替换进度条

如果你不喜欢默认的进度条,你可以使用 -a 选项来替换进度条。

  1. # axel -a https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
  2. Initializing download: https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
  3. File size: 22678208 bytes
  4. Opening output file owncloud-9.0.0.tar.bz2
  5. Starting download
  6. [ 66%] [......0 ...1 ..........2 ...........3] [ 5.8MB/s] [00:01]^C
  7. Downloaded 14.3 megabytes in 2 seconds. (5916.11 KB/s)

我们中断了上面的下载,以便在下载文件时能清楚地显示替代进度条状态。一旦文件成功下载后,你可以看到相同的输出,如下所示。

  1. # axel -a https://download.owncloud.org/community/owncloud-9.0.0.tar.bz2
  2. File size: 22678208 bytes
  3. Opening output file owncloud-9.0.0.tar.bz2
  4. Starting download
  5. Connection 2 finished ]
  6. Connection 1 finished ]
  7. Connection 3 finished ]
  8. Connection 0 finished ]
  9. Downloaded 21.6 megabytes in 4 seconds. (5062.32 KB/s)

8) 了解关于 axel 的更多信息

如果你想要了解更多关于 axel 的选项,只需要进入它的手册。

  1. # man axel
  2. 或者
  3. # axel --help

享受吧……

Axel 快速下载的更多相关文章

  1. 使用SSH快速下载Git项目

    文章首发于[博客园-陈树义],点击跳转到原文使用SSH快速下载Git项目. Git下载项目的几种方式 Git是常用的代码版本技术,而GitLab则是开源的Git版本管理软件,GitLab是最受欢迎的版 ...

  2. python_如何快速下载安装第三方库?

    如何快速下载安装第三方库? --通过 淘宝源  https://mirrors.aliyun.com/pypi/simple/ 本国网络进行快速安装 如何执行安装命令? pip install Dja ...

  3. 应用市场快速下载以及网页端调起APP页面研究与实现

    Github博文地址,此处更新可能不是非常及时. 好久没写博客了,好大一个坑. 正好,近期刚做完应用市场的快速下载功能,便拿来填了这个坑. 话说产品为了添加用户量,提升用户活跃度以及配合推广,更坑爹的 ...

  4. pip快速下载安装python 模块module

    g刚开始学习python时,每次想要安装某个module,都到处找module的安装包(exe.whl等) 装setuptools,然后在cmd里用easy_install装pip,然后用pip装你要 ...

  5. Docker入门之 - 更换源为国内源,实现快速下载image

    原文:Docker入门之 - 更换源为国内源,实现快速下载image 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/u012055638/artic ...

  6. axel 多线程下载工具

    yum install axel-2.4-9.el7.x86_64 -y # 选项 --max-speed=x , -s x 最高速度x --num-connections=x , -n x 连接数x ...

  7. 百度网盘快速下载工具下载:Pandownload下载

    众所周知的百度网盘下载限速很厉害,所以就有了快速下载工具出现了.一般情况下,按照家里网速有多快,使用工具下载就有多快. 可以直接复制如下图进行下载: 另外,PanDownload[百度网盘下载工具]无 ...

  8. conda安装的国内镜像配置,实现快速下载

    conda安装的国内镜像配置,实现快速下载 anaconda的所有的软件包全部在国外,安装起来很麻烦,关键是下载速度慢,而且经常中断,所以需要配置国内安装的镜像,下载速度就很快了. 一.conda换国 ...

  9. oracle官网下载jdk跑不动太慢了,给出快速下载方式mac

    oracle官网下载jdk8跑不动太慢了,给出快速下载方式 之前在oracle官网下载jdk1.8实在速度太慢,只有20K左右的下载速度,有时候甚至不动,最关键的慢也就算了,cookie有效期有限,有 ...

随机推荐

  1. JVM性能监控

    有时候我们会碰到下面这些问题: OutOfMemoryError,内存不足 内存泄露 线程死锁 锁争用(Lock Contention) Java进程消耗CPU过高 这些问题在日常开发中可能被很多人忽 ...

  2. enumerate的简单使用

    l = [11,22,33,55,"ss","zz"] for i,v in enumerate(l): print(i,v) #打印结果: # 0 11 # ...

  3. Windows环境下文件的彻底删除与恢复,推荐几个工具(整理)

    1. 背景 在Windows(从XP到Win7)中删除文件时,无论是Delete或者是Shift+Delete,都不能真正的删除文件,它做的事情只是从文件分配表中删除了该文件的信息,而并未将文件从存储 ...

  4. ASP.NET的一些小问题

    如何获取网站当前绝对路径? string path = HttpRuntime.AppDomainAppVirtualPath; 注:该路径结尾不含'/'.

  5. [hihoCoder] #1096 : Divided Product

    时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 Given two positive integers N and M, please divide N into sev ...

  6. [svc]logstash和filebeat之间ssl加密

    cfssl生成证书 wget https://pkg.cfssl.org/R1.2/cfssl_linux-amd64 -O /usr/local/bin/cfssl wget https://pkg ...

  7. [svc]centos7安装优化最佳姿势

    源/软件/时区/selinux/ulimit/vim/sshd 下载安装: https://mirrors.aliyun.com/centos/7.4.1708/isos/x86_64/CentOS- ...

  8. DrawPrimitivesTest

    #ifndef _DRAW_PRIMITIVES_TEST_H_ #define _DRAW_PRIMITIVES_TEST_H_ ////----#include "cocos2d.h&q ...

  9. Interception c# code

    http://www.codetails.com/2012/12/02/intercepting-method-calls-using-il/20121202/ http://blogs.msdn.c ...

  10. eclipse偶尔会反映迟钝,直接无视其报错

    比如,你在web.xml中配置了什么东西,在有的时候不一定就会立即被eclipse察觉到,即便你的配置正确了,甚至重启了几次服务器,它仍然给你报错 比如说,刚才我在web.xml中配置了一个tagli ...