linux axel 命令介绍
axel 是一个轻量级的命令行下载加速器,旨在提高从 HTTP、HTTPS 和 FTP 服务器下载文件的速度。它通过将文件分割成多个部分并同时下载这些部分来加速下载过程,从而显著提高下载效率。
axel 是Linux下一个不错的HTTP/ftp高速下载工具。支持多线程下载、断点续传,且可以从多个地址或者从一个地址的多个连接来下载同一个文件。适合网速不给力时多线程下载提高下载速度。比如在国内VPS或服务器上下载lnmp一键安装包用Axel就比wget快。
一:安装部署
root@meng:~# axel
Command 'axel' not found, but can be installed with:
snap install axel # version 2.17.14, or
apt install axel # version 2.17.11-1
See 'snap info axel' for additional versions.
root@meng:~# which axel
root@meng:~# apt install axel
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
axel
0 upgraded, 1 newly installed, 0 to remove and 214 not upgraded.
Need to get 58.7 kB of archives.
After this operation, 204 kB of additional disk space will be used.
Get:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy/universe amd64 axel amd64 2.17.11-1 [58.7 kB]
Fetched 58.7 kB in 2s (38.3 kB/s)
Selecting previously unselected package axel.
(Reading database ... 75036 files and directories currently installed.)
Preparing to unpack .../axel_2.17.11-1_amd64.deb ...
Unpacking axel (2.17.11-1) ...
Setting up axel (2.17.11-1) ...
Processing triggers for man-db (2.10.2-1) ...
Scanning processes...
Scanning linux images...
Running kernel seems to be up-to-date.
No services need to be restarted.
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
二:命令介绍
root@meng:~# axel
Axel 2.17.11 (linux-gnu)
Usage: axel [options] url1 [url2] [url...]
--max-speed=x -s x Specify maximum speed (bytes per second)
--num-connections=x -n x Specify maximum number of connections
--max-redirect=x Specify maximum number of redirections
--output=f -o f Specify local output file
--search[=n] -S[n] Search for mirrors and download from n servers
--ipv4 -4 Use the IPv4 protocol
--ipv6 -6 Use the IPv6 protocol
--header=x -H x Add HTTP header string
--user-agent=x -U x Set user agent
--no-proxy -N Just don't use any proxy server
--insecure -k Don't verify the SSL certificate
--no-clobber -c Skip download if file already exists
--quiet -q Leave stdout alone
--verbose -v More status information
--alternate -a Alternate progress indicator
--percentage -p Print simple percentages instead of progress bar (0-100)
--help -h This information
--timeout=x -T x Set I/O and connection timeout
--version -V Version information
Visit https://github.com/axel-download-accelerator/axel/issues to report bugs
三:案例
root@meng:~# axel -n 3 https://umimeta-sit.bj.bcebos.com/ai/avatar/2d/0c86af62-fd21-4a77-be08-a53c49bd8c8f.zip
Initializing download: https://umimeta-sit.bj.bcebos.com/ai/avatar/2d/0c86af62-fd21-4a77-be08-a53c49bd8c8f.zip
File size: 19.639 Megabyte(s) (20593006 bytes)
Opening output file 0c86af62-fd21-4a77-be08-a53c49bd8c8f.zip
Starting download
Connection 0 finished
Connection 1 finished
[100%] [..............................................................................................................................] [ 2.5MB/s] [00:00]
Downloaded 19.639 Megabyte(s) in 7 second(s). (2536.45 KB/s)