How to Download a File with aria2 Command Syntax?

The aria2 command-line utility is a lightweight, multi-protocol download tool that supports HTTP, HTTPS, FTP, SFTP, BitTorrent, and Metalink. Initiating a basic download requires only the aria2c command followed by the target URL. Because it automatically attempts to split files and download them using multiple connections, it can significantly speed up your transfer times compared to traditional command-line downloaders.

The Basic Command Syntax

To start a standard, single-file download with its default settings, open your terminal and use the following syntax:

aria2c "URL"

For example, to download a Linux distribution ISO file, the command would look like this:

aria2c "https://example.com/linux-distro.iso"

Key Default Behaviors

  • File Naming: By default, aria2 parses the URL and saves the file under its original remote filename in your current working directory.
  • Connection Splitting: Even without adding extra flags, aria2 will automatically attempt to use up to 5 connections per host to accelerate the download process, depending on the server's capabilities.
  • Resume Capability: If a download is interrupted, running the exact same command again in the same directory will prompt aria2 to resume the transfer from where it left off, rather than starting over from scratch.

Customizing the Output Name and Location

If you want to save the download with a different name or direct it to a specific folder, you can use the -o (lowercase) or -d switches:

  • Change the filename: aria2c -o "new-name.iso" "https://example.com/linux-distro.iso"
  • Change the download directory: aria2c -d "/path/to/downloads" "https://example.com/linux-distro.iso"