How to Download a Single File Using Wget?

The wget command is a powerful, command-line utility used for downloading files from the internet via HTTP, HTTPS, and FTP protocols. This article provides a quick overview of how to use wget to download a single file, customize the output filename, resume interrupted downloads, and limit download speeds. By mastering these basic commands, you can efficiently manage file downloads directly from your terminal.

The Basic Wget Command

The most straightforward way to download a single file using wget is to pass the file’s URL as an argument. By default, wget will download the file to your current working directory and save it under its original name.

wget https://example.com/file.zip

Saving a File with a Different Name

If you want to save the downloaded file under a specific name instead of the default remote filename, use the -O (uppercase letter O) option followed by your desired name.

wget -O custom_name.zip https://example.com/file.zip

Resuming an Interrupted Download

If a large file download gets cut off due to a poor network connection, you can resume it right where it left off using the -c option. This saves time and bandwidth by avoiding a complete restart.

wget -c https://example.com/large-file.iso

Limiting the Download Speed

To prevent wget from consuming all your available network bandwidth, you can cap the download speed using the --limit-rate option. You can specify the speed in kilobytes (k) or megabytes (m).

wget --limit-rate=500k https://example.com/video.mp4