Commands.page Logo

Download Links from Text File Using aria2c on Ubuntu

This article provides a step-by-step method to batch download URLs stored in a text file using aria2c on Ubuntu. It covers installation, file preparation, and execution commands to streamline your downloading workflow.

Install aria2

Open your terminal and update your package list before installing the tool. Run the following command to install aria2, which includes the aria2c utility:

sudo apt update
sudo apt install aria2

Prepare the Input File

Create a text file containing the URLs you wish to download. Each link must be on a separate line. You can create this file using a text editor like nano or echo commands. For example, create a file named links.txt:

nano links.txt

Paste your URLs into the file and save it. Ensure there are no empty lines or comments unless specified in advanced configurations.

Execute the Download Command

Navigate to the directory containing your text file in the terminal. Use the -i flag followed by the filename to instruct aria2c to read inputs from the file. Run the following command:

aria2c -i links.txt

This will start downloading all listed URLs sequentially or concurrently based on default settings.

Optional Configuration

You can customize the download process using additional flags. To set a specific download directory, use the -d option. To increase the number of concurrent connections per file, use the -x flag. For example, to download into a folder named Downloads with 16 connections:

aria2c -i links.txt -d ./Downloads -x 16

Monitor the terminal output to track the progress and completion status of your files.