How to Rename Downloads in aria2?
This article provides a quick overview and direct solution for changing the default filename of a download when using the aria2 command-line utility. By default, aria2 uses the filename provided by the remote server, but you can easily override this behavior using a specific command-line option. Below, you will find the exact flag required, along with practical examples of how to implement it in your terminal.
The -o (or
--out) Flag
To rename a downloaded file in aria2, you need to use the
-o or --out flag followed by your desired
filename. This tells aria2 to ignore the server’s suggested filename and
save the output exactly as you specify.
Command Syntax
The basic syntax for the command is as follows:
aria2c -o "new_name.ext" "URL"
Practical Examples
- Downloading a Linux ISO with a custom name:
aria2c -o "ubuntu-latest.iso" "https://releases.ubuntu.com/24.04/ubuntu-24.04-desktop-amd64.iso" - Downloading a document and forcing a specific
extension:
aria2c --out="financial_report.pdf" "https://example.com/d/xyz123"
Important Considerations
- Quotes: It is best practice to wrap your desired filename in quotes, especially if it contains spaces or special characters.
- Placement: The
-oflag must be placed before the download URL in your command line sequence. - Multi-file Downloads: If you are downloading a
torrent or a magnet link that contains multiple files, the
-oflag changes the name of the top-level directory or the single file if the torrent only contains one file.