LinuxCommandLibrary

aria2c

Download files from the command line

TLDR

Download a specific URI to a file

$ aria2c "[url]"
copy

Download a file from a URI with a specific output name
$ aria2c --out [path/to/file] "[url]"
copy

Download multiple different files in parallel
$ aria2c --force-sequential [false] "[url1 url2 ...]"
copy

Download the same file from different mirrors and verify the checksum of the downloaded file
$ aria2c --checksum [sha-256]=[hash] "[url1]" "[url2]" "[urlN]"
copy

Download the URIs listed in a file with a specific number of parallel downloads
$ aria2c --input-file [path/to/file] --max-concurrent-downloads [number_of_downloads]
copy

Download with multiple connections
$ aria2c --split [number_of_connections] "[url]"
copy

FTP download with username and password
$ aria2c --ftp-user [username] --ftp-passwd [password] "[url]"
copy

Limit download speed in bytes/s
$ aria2c --max-download-limit [speed] "[url]"
copy

SYNOPSIS

aria2c [OPTIONS] [URI | FILE]...
aria2c [OPTIONS] --input-file=FILE
aria2c [OPTIONS] --torrent=FILE
aria2c [OPTIONS] --metalink=FILE

PARAMETERS

-s, --split=N
    Number of connections to download a file. Default is 1.

-x, --max-concurrent-downloads=N
    Maximum number of active parallel downloads. Default is 5.

-c, --continue
    Continue downloading a partially downloaded file.

-o, --out=FILE
    Specify the output filename.

-d, --dir=DIR
    Specify the directory to save the downloaded file(s).

-i, --input-file=FILE
    Read URIs from a text file, one per line.

--torrent=FILE
    Download file(s) specified in a BitTorrent .torrent file.

--metalink=FILE
    Download file(s) specified in a Metalink XML file.

--enable-rpc
    Enable JSON-RPC/XML-RPC server.

--rpc-listen-port=PORT
    Set the port for the RPC server (default 6800).

--dry-run
    Perform a dry run without actually downloading.

-V, --version
    Show the version number and exit.

-h, --help[=CATEGORY]
    Show help message.

DESCRIPTION

aria2c is a powerful, lightweight, multi-protocol & multi-source command-line download utility. It supports HTTP/HTTPS, FTP, SFTP, BitTorrent, and Metalink. A key feature of aria2c is its ability to download a file from multiple sources/protocols simultaneously, maximizing download speed by utilizing all available bandwidth. It automatically resumes downloads if interrupted, handles recursive downloads for FTP and HTTP, and supports segmented downloading for individual files. With its low resource consumption and an optional built-in JSON-RPC and XML-RPC interface, aria2c is an excellent choice for scripting, server environments, and integrating with web-based download managers.

CAVEATS

While powerful, aria2c is a command-line tool, lacking a native GUI. Managing numerous downloads or complex configurations can sometimes be challenging without external tools or a good understanding of its extensive options. It consumes resources proportional to the number of active connections and downloads, which can be significant on low-end systems if not configured carefully. Downloading from untrusted sources, as with any download utility, carries inherent security risks.

RPC INTERFACE FOR AUTOMATION

aria2c's built-in JSON-RPC and XML-RPC server is a standout feature. It allows external applications or scripts to control aria2c, add new downloads, query status, and manage active tasks. This enables the creation of web-based UIs (like webui-aria2), desktop clients, or seamless integration into complex download workflows.

MULTI-SOURCE & SEGMENTED DOWNLOADING

Beyond basic multi-connection downloading, aria2c can intelligently download segments of a single file from multiple different HTTP/FTP/SFTP sources simultaneously, if multiple URIs for the same file are provided. This, combined with its ability to split files into chunks and download them concurrently, significantly boosts download throughput, especially for large files or when connections to individual sources are slow.

HISTORY

aria2c was created by Tatsuhiro Tsujikawa. Its development began with a focus on delivering a high-performance, multi-protocol download utility for Linux and Unix-like systems. Over time, it expanded its capabilities to include support for BitTorrent and Metalink, making it a versatile tool for various downloading needs. It gained popularity for its ability to maximize download speeds by splitting files into segments and downloading them concurrently from multiple sources, as well as its efficient resource usage.

SEE ALSO

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

Copied to clipboard