Can You Pause and Resume a Wget Download Later?
This article provides a quick overview of how to pause a running
wget file download and resume it at a later date without
losing your progress. You will learn the specific keyboard shortcuts and
command-line flags required to halt a transfer, as well as the essential
conditions your target server must meet for the resumption to be
successful.
How to Pause a Running Wget Download
If you currently have a large download running in your terminal and need to pause it immediately, you can use standard Unix job control signals.
- Press
Ctrl + Zwhile the download is active in your terminal. - This sends a
SIGTSTP(terminal stop) signal, which immediately freezes thewgetprocess and puts it in the background. - Your terminal will display a message like
[1]+ Stopped wget <URL>.
If you intend to resume the download during the same terminal
session before shutting down your computer, you can simply type
fg (foreground) and press Enter to pick up
right where you left off.
How to Resume a Wget Download at a Later Date
If you need to shut down your computer, disconnect from the network, or resume the download days later, you must completely stop the process and use a specific flag when you restart it.
First, if you used Ctrl + Z to pause, you can safely
close the terminal or kill the process using
Ctrl + C. wget will leave a
partially downloaded file in your current directory (e.g.,
largefile.zip.tmp or just largefile.zip).
When you are ready to resume the download at a later date, navigate
to the same folder where the partial file is saved and use the
-c (or
--continue) flag:
wget -c https://example.com/largefile.zipThe -c flag tells wget to look at the local
file, see how much of it has already been downloaded, and ask the server
to send the remaining bytes starting from that exact point.
Crucial Requirements for Resuming Downloads
While wget makes this process simple, successful
resumption depends heavily on the hosting server.
- Server Support for Range Requests: The remote
server hosting the file must support HTTP Range
Requests. If the server does not support this feature,
wgetwill ignore the partial local file and restart the download from 0%. - Unchanged Source File: The file on the server must
not have changed since you started the download. If the server
administrator updates the file in the days between your pause and
resume,
wgetmay refuse to resume it, or the resulting file will be corrupted. - Identical Filename: You must run the resume command
in the same directory where the partial file exists, and the filename
must match what
wgetexpects.