Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Aria2 to download files in Linux

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

How to use Aria2 to download files in Linux, for this problem, this article introduces the corresponding analysis and answers in detail, hoping to help more partners who want to solve this problem to find a more simple and easy way.

Aria2 is a free open source lightweight multiprotocol command line utility that downloads files from Internet. It supports various protocols, such as HTTP,HTTPS,FTP and even BitTorrent. Aria2 can be run on Windows,Linux and Mac OSX.

The following are the main functions of Aria2:

Main features

1) low resource footprint: Aria2 is very lightweight and takes up a small portion of CPU and memory. Normal FTP/HTTP download takes up about 4MB of memory. The memory used for BitTorrent download is about 9MB.

2) Multi-connection download: Aria2 is a multi-protocol download tool that supports multiple protocols and tries to use as much bandwidth as possible to speed up downloads.

3) remote control: Aria2 supports RPC interface, more specifically JSON-RPC and XML-RPC.

4) full-featured BT functions: these features include seed files, magnetic links, encryption, selective downloads and local peer discovery.

Install Aria2

Install Aria2 in Ubuntu / Deepin:

$sudo apt install aria2

Install Aria2 in Centos7/8:

# yum-y install epel-release# yum-y install aria2

Install Aria2 in Arch / Manjaro:

$sudo pacman-S aria2

Aria2 usage example

Here are some uses of the Aria2 command line tool.

1. Download a single file through the network

Syntax:

# aria2c URL

Download QQ for Linux as an example and run the following command:

[root@localhost ~] # aria2c http://down.qq.com/qqweb/LinuxQQ/linuxqq_2.0.0-b2-1084_x86_64.rpm

2. Save the file under a different name after download

To save the file under a different name, use the-o option, as shown below, and change the file name to linux-qq.rpm:

[root@localhost] # aria2c-o linux-qq.rpm http://down.qq.com/qqweb/LinuxQQ/linuxqq_2.0.0-b2-1084_x86_64.rpm

3. Download multiple files

To download multiple files, use the-Z option, followed by the URL address where you want to download the file, and the following example downloads the linux version of qq and the linux version of the sunflower command line client.

[root@localhost ~] # aria2c-Z linux-qq.rpm http://down.qq.com/qqweb/LinuxQQ/linuxqq_2.0.0-b2-1084_x86_64.rpm https://down.oray.com/sunlogin/linux/sunloginclientshell-10.1.1.28779.x86_64.rpm

4. Download files from the list

You can create a file that lists all files URL instead of listing all file URL addresses on the terminal. You can use the-I option. The following example downloads multiple files. First, take a look at the file where the url address is stored:

[root@localhost ~] # cat pic_download.txt https://www.linuxprobe.com/wp-content/uploads/2021/01/windows7.pnghttps://www.linuxprobe.com/wp-content/uploads/2016/12/bigdata.jpghttps://www.linuxprobe.com/wp-content/uploads/2021/01/write-games-and-learn-python.jpghttps://www.linuxprobe.com/wp-content/uploads/2021/01/data-center-inspection.jpghttps://www.linuxprobe .com / wp-content/uploads/2020/03/devolop-like-linux-09.jpg

Then use the-I option to download:

[root@localhost] # aria2c-I pic_download.txt

5. Limit the download speed

By default, aria2 uses the maximum bandwidth to download files. You can use the-- max-download-limit option to limit bandwidth, and the download speed is limited to 100K below. :

[root@localhost ~] # aria2c-- max-download-limit=100K http://down.qq.com/qqweb/LinuxQQ/linuxqq_2.0.0-b2-1084_x86_64.rpm

6. Breakpoint continuation

You can use the-c option to continue downloading files that have not been downloaded:

[root@localhost] # aria2c-c-- max-download-limit=100K http://down.qq.com/qqweb/LinuxQQ/linuxqq_2.0.0-b2-1084_x86_64.rpm

Currently this option is only available for HTTP (S) / FTP downloads.

7. Download the magnetic link file

To download a magnetic link file, if there is no speed to download, you can add the-bt-tracker= option, followed by the address of tracker, followed by the BT seed or magnetic link address:

[root@localhost ~] # aria2c-- bt-tracker=udp://tracker.opentrackr.org:1337/announce,udp://tracker.cyberia.is:6969/announce,udp://exodus.desync.com:6969/announce,udp://3rt.tace.ru:60889/announce, http://5rt.tace.ru:60889/announce, Udp://tracker.internetwarriors.net:1337/announce magnet:?xt=urn:btih:45521E5D3C26890BAAA2928BC511D1BE88074518&dn=cn_windows_10_business_editions_version_20h3_updated_dec_2020_x64_dvd_547eb680.iso&xl=5982177280

As you can see, the download speed is still very fast.

The Tips:Tracker address is in github. If there is no speed, you can change several tracker addresses. Https://github.com/ngosang/trackerslist/blob/master/trackers_best.txt . Each address is separated by a comma.

This is the answer to the question about how to use Aria2 to download files in Linux. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report