Linux 多线程下载工具 axel 下载加速器
简介
在 Linux 命令行下载网络文件,常用的工具是 wget,但是 wget 是单线程的,下载速度慢。 本文介绍另一款工具,axel, 以多线程的方式下载网络文件,速度更快。
axel 具有以下主要功能:
-
多线程 断点续传
axel 安装
1. Ubuntu 环境
sudo apt update sudo apt install axel
2. Centos 环境
yum install axel
3. 源码安装
git clone https://github.com/axel-download-accelerator/axel.git cd axel ./configure && make && make install
使用
axel -n [线程数] [网络文件的地址] 如:
# 开启10个线程下载 axel -n 10 https://github.com/axel-download-accelerator/axel/archive/refs/heads/master.zip
所有命令
ubuntu@ubuntu:~$ axel -h 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 dont use any proxy server --insecure -k Dont 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 --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
上一篇:
通过多线程提高代码的执行效率例子
下一篇:
静态方法和静态代码块