Commands.page Logo

How to Specify Output Filename with aria2c on Ubuntu

This guide explains how to customize the download filename when using the aria2c command-line utility on Ubuntu. By default, aria2c saves files using their remote names, but you can override this behavior with a specific flag. We will cover the exact syntax and provide examples to ensure your downloads are saved with your preferred names immediately.

Use the -o Option

To define a custom filename for your download, use the -o or --out command-line option followed by your desired filename. This tells aria2c to save the incoming data to the specified local file name instead of the default name derived from the URL.

The basic syntax is:

aria2c -o [desired_filename] [URL]

Practical Examples

If you want to download a file from a website but save it as backup.zip instead of its original name, run the following command in your terminal:

aria2c -o backup.zip http://example.com/file-v1.2.zip

You can also specify a path relative to your current directory. To save the file directly into a folder named Downloads, use:

aria2c -o Downloads/backup.zip http://example.com/file-v1.2.zip

Important Notes

The -o option works best when downloading a single file. If you provide multiple URLs in a single command, aria2c may ignore the output filename option for subsequent files to prevent data overwriting. For single file downloads, this method ensures precise control over your file management on Ubuntu.