Wget is a command-line utility for downloading files from the internet, commonly used in Linux and Unix-like systems. Downloads can be interrupted for various reasons, such as network failures or accidental system shutdowns. In such cases, restarting the download can lead to wasted time and bandwidth, especially with large files.
Wget provides an option to resume interrupted downloads, making it an efficient tool for downloading large or long files. The resume feature allows the program to continue downloading from where it stopped. It detects the partially downloaded file and downloads only the remaining portion without starting over.
This ability depends on whether the server supports byte-range requests, which is required to resume a download. Not all servers allow this, so Wget will only work for resuming if the server has this functionality enabled. If supported, you can easily resume the download using the correct Wget options.
Steps to resume an interrupted download using Wget:
- Open the terminal.
- Navigate to the directory where the partially downloaded file is located.
$ cd ~/Downloads
- Use the Wget command with the -c option to continue the download.
$ wget -c https://example.com/large-file.zip --2024-09-16 12:00:00-- https://example.com/large-file.zip Resolving example.com (example.com)... 93.184.216.34 Connecting to example.com (example.com)|93.184.216.34|:443... connected. HTTP request sent, awaiting response... 206 Partial Content Length: 1024000000 (976M), 512000000 (488M) remaining [application/zip] Saving to: ‘large-file.zip’ large-file.zip 51%[++++++ ] 488M 10MB/s eta 40s
The -c or --continue option tells Wget to continue downloading from where it was interrupted. It checks the size of the existing file and resumes from there.
- Monitor the progress in the terminal to ensure the download is continuing.
- Wait until the download is complete.
large-file.zip 100%[+++++++++++++++] 976M 12MB/s in 41s
- If provided, verify the file's integrity using a checksum.
$ sha256sum large-file.zip a3b5c29e5e12ff22be1234567890abcd1234567890efabcd1234567890abcdef large-file.zip
Checking the file’s checksum ensures the download was not corrupted. Use the provided checksum to validate the file.
Mohd Shakir Zakaria is an experienced cloud architect with a strong development and open-source advocacy background. He boasts multiple certifications in AWS, Red Hat, VMware, ITIL, and Linux, underscoring his expertise in cloud architecture and system administration.
Comment anonymously. Login not required.