LinuxCommandLibrary

aria2

Download files from multiple sources

TLDR

View documentation for the updated command

$ tldr aria2c
copy

SYNOPSIS

aria2c [OPTIONS...] [URI...]

PARAMETERS

--dir=<DIR>
    Set download directory (<DIR>).

--out=<FILE>
    Set output filename (<FILE>).

--max-connection-per-server=<NUM>
    Max connections per server (default: 1).

--split=<NUM>
    Split file into <NUM> pieces (default: 5).

--max-concurrent-downloads=<NUM>
    Max concurrent downloads (default: 5).

--max-overall-download-limit=<SPEED>
    Max overall download speed in bytes/sec.

--max-download-limit=<SPEED>
    Max download speed per download in bytes/sec.

--continue
    Continue download if exists (default: true).

--input-file=<FILE>
    Read URIs from <FILE>.

--save-session=<FILE>
    Save related info to <FILE> for resume.

--daemon=true
    Run as daemon with RPC server.

--enable-rpc
    Enable JSON-RPC server (default: false).

--rpc-listen-all=true
    Listen on all interfaces for RPC.

--rpc-secret=<TOKEN>
    RPC authorization token.

--conf-path=<FILE>
    Load options from config <FILE>.

--checksum=<TYPE:VALUE>
    Verify file checksum (e.g., sha1=abc...).

--seed-time=<SEC>
    Seed torrent for <SEC> seconds.

--bt-max-peers=<NUM>
    Max BitTorrent peers (default: 55).

--header=<STRING>
    Add HTTP header.

--user-agent=<STR>
    Set custom User-Agent string.

--dry-run
    No actual downloading, just check.

--help
    Show help message.

--version
    Print version info.

DESCRIPTION

aria2c is a versatile, lightweight command-line download manager supporting multiple protocols including HTTP/HTTPS, FTP, SFTP, BitTorrent, and Metalink. It excels in multi-source downloads, splitting files into pieces for parallel retrieval from various servers to boost speed. Key features include connection throttling, bandwidth limits, clipboard monitoring, and a powerful JSON-RPC interface for remote control via GUI frontends like aria2gui or web UIs.

Unlike single-threaded tools like wget, aria2c uses multiple connections (up to 16 per server by default) and sources, ideal for slow networks or large files. It handles magnet links, torrent files with DHT, PEX, and LPD support, plus Metalink for automatic mirror selection. Downloads resume automatically, with integrity checks via checksums. Daemon mode (--daemon=true) enables background operation and RPC server for programmatic control.

Configuration is flexible via command-line options, a config file (~/.aria2/aria2.conf), or input files. It's cross-platform, memory-efficient, and script-friendly, making it a go-to for automation in shell scripts or CI/CD pipelines.

CAVEATS

High option count can overwhelm; use --conf-path for complex setups. BitTorrent features require libaria2 built with BT support. RPC port (default 6800) may need firewall rules. Large torrents consume memory proportional to peers.

CONFIGURATION FILE

Default ~/.aria2/aria2.conf. Format: key=value (no quotes). Example: dir=/downloads
dir=/downloads

RPC USAGE

curl http://localhost:6800/jsonrpc -d '{"jsonrpc":"2.0","method":"aria2.addUri","id":1,"params":[["http://example.com/file.zip"]]}'

METALINK SUPPORT

Auto-selects fastest mirrors from .metalink files with checksum/location data.

HISTORY

Developed by Tatsuhiro Tsujikawa starting 2006. Initial release as aria2 1.0.0 in 2009. Now at version 1.37+ (2023), maintained on GitHub with 30k+ stars. Evolved from HTTP/FTP tool to full multi-protocol suite, adding RPC in 1.7 (2011) and Metalink v4 support.

SEE ALSO

wget(1), curl(1), axel(1), transmission-cli(1)

Copied to clipboard