Skip to content

/flags/wget/wget-continue

wget -c (--continue): resume a partially downloaded file

The commands on this page have not been executed by our verification runner yet.updated
tool
wget
command
wget
flag
-c, --continue
default
off (an existing file is kept and the download is saved as FILE.1)

wget -c URL continues a download that stopped part-way. If a file with the same name exists in the current directory, wget asks the server only for the bytes after the end of that file (an HTTP Range request) and appends them. Without -c, wget leaves the partial file alone and starts over, saving the new copy as FILE.1.

Usage

bash
# first attempt is interrupted (Ctrl+C, network drop)
wget https://example.org/big.iso

# resume it
wget -c https://example.org/big.iso

# resume automatically: retry forever and wait between attempts
wget -c --tries=0 --waitretry=10 https://example.org/big.iso

A connection lost in the middle of a single wget run is retried and resumed automatically; -c is for continuing a file left behind by an earlier run or by another program. Run the second command from the same directory, with the same output name (-O or the name taken from the URL), so wget finds the partial file.

What can happen

SituationResult with -c
Server supports Range (answers 206 Partial Content)only the missing bytes are downloaded and appended
Server ignores Range (answers 200)wget refuses to append and does not restart from scratch, to avoid corrupting the file
Local file is already completewget reports that the file is fully retrieved and does nothing
Remote file changed since the first attemptwget cannot tell; the result is a mix of two versions
OptionEffect
-t N, --tries=Nnumber of retries (0 = unlimited); the default is 20
--waitretry=SECONDSwait between retries, growing up to this value
-nc, --no-clobberskip files that already exist instead of downloading them again
-N, --timestampingdownload only if the remote file is newer than the local one
--start-pos=OFFSETstart at a byte offset; if both are given, --start-pos wins and -c is ignored with a warning

The curl equivalent is curl -C - -O URL, where -C - tells curl to work out the resume offset from the existing output file.

Sources