Axel简介
Axel是一个开源的多协议HTTP/HTTPS下载工具,支持HTTP、HTTPS、FTP、SFTP、BitTorrent和Metalink等多种协议,它具有速度快、占用资源少、支持断点续传等特点,适用于Linux系统下的文件下载。
如何在Linux系统中安装Axel
1、更新系统软件包列表
在安装Axel之前,首先需要更新系统的软件包列表,在终端中输入以下命令:
sudo apt-get update
2、安装依赖库
Axel依赖于libcurl4-openssl-dev和libssl-dev这两个库,所以需要先安装这两个库,在终端中输入以下命令:
sudo apt-get install libcurl4-openssl-dev libssl-dev
3、下载Axel源码
从GitHub上下载Axel的源码包,或者使用以下命令直接下载:
wget https://github.com/axel-download-mirror/axel/archive/refs/tags/3.86.tar.gz
4、解压源码包
将下载好的源码包解压到一个目录中:
tar -zxvf 3.86.tar.gz
5、编译并安装Axel
进入解压后的目录,然后执行以下命令进行编译和安装:
cd axel-3.86/src/main/cmake/axel_build_linux_release cmake .. -DCMAKE_BUILD_TYPE=Release -DUSE_SSL=ON -DUSE_LIBCURL=ON -DUSE_BUNDLED_ZLIB=OFF -DUSE_BUNDLED_OPENSSL=ON -DUSE_BUNDLED_LIBRT=OFF -DUSE_BUNDLED_LZO=OFF -DUSE_BUNDLED_LZ4=OFF -DUSE_BUNDLED_SNAPPY=OFF -DUSE_BUNDLED_ZSTD=OFF -DUSE_BUNDLED_ZSTD_STATIC=OFF -DUSE_BUNDLED_ZSTD_DYNAMIC=OFF -DUSE_BUNDLED_BROTLI=OFF -DUSE_BUNDLED_BZIP2=OFF -DCMAKE_INSTALL_PREFIX=/usr/local make && sudo make install
如何使用Axel下载文件
1、打开终端,进入Axel的安装目录:
cd /usr/local/bin/axel/src/main/resources/bin/linux64/release/axel
2、使用Axel下载文件,语法如下:
axel <url> [<output file path>] [<max connections>] [<thread count>] [<timeout in seconds>] [<resumable download>] [<split files>] [<split size>] [<skip headers>] [<follow redirects>] [<proxy server host>] [<proxy server port>] [<proxy username>] [<proxy password>] [<user agent string>] [<custom headers>] [<cookie jar file path>] [<cookies from domain name>] [<force resume download>] [<force reconnection to the same server>] [<randomize order of downloads>] [<download only new files or updates>] [<remove existing files before downloading>] [<delete downloaded files after completion>] [<enable http range requests for resumable downloads>] [<enable http authentication for resumable downloads>] [<enable http cookies for resumable downloads>] [<enable http user agents for resumable downloads>] [<use custom user agents for resumable downloads>] [<use custom headers for resumable downloads>] [<use custom cookie jar for resumable downloads>] [<use custom proxy settings for resumable downloads>] [<use custom download order for resumable downloads>] [<use custom file naming scheme for resumable downloads>] [<use custom file storage directory for resumable downloads>] [<use custom file naming prefix and suffix for resumable downloads>] [<use custom file storage directory and naming scheme for resumable downloads>] [<use custom file storage directory and prefix and suffix for resumable downloads>] [<use custom file storage directory and naming scheme and prefix and suffix for resumable downloads>] [<use custom file storage directory and naming scheme and prefix and suffix and other options for resumable downloads>]
3、要下载一个名为example.txt的文件,可以使用以下命令:
axel https://www.example.com/example.txt example.txt 10 50 --no-resume --split-files --split-size 10M --randomize-order --remove-existing --delete-after --http-header 'User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537' --http-auth 'username:password' --http-proxy 'proxyserver:port' --http-cookies 'domain:name' --download-dir '/home/user/Downloads' --http-range 'bytes=0-1023' --http-follow-redirects --http-no-headers --http-post-fields 'key=value' --http-post-files 'file1=/path/to/file1;file2=/path/to/file2' --http-user-agent 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537' --http-cookies 'domain:name' --http-auth 'username:password' --http-proxy 'proxyserver:port' --http-no-headers --http-post-fields 'key=value' --http-post-files 'file1=/path/to/file1;file2=/path/to/file2' --http-user-agent 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537' --http-cookies 'domain:name' --http-auth 'username:password' --http-proxy 'proxyserver:port' --http-no-headers --http-post-fields 'key=value' --http-post-files 'file1=/path/to/file1;file2=/path/to/file2' --http-user-agent 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537' --http-cookies 'domain:name' --http-auth 'username:password' --http-proxy 'proxyserver:port' --http-no-headers --http-post-fields 'key=value' --http-post-files 'file1=/path/to/file1;file2=/path/to/file2' --http-user-agent 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit
原创文章,作者:K-seo,如若转载,请注明出处:https://www.kdun.cn/ask/214710.html