Network and remote access

Command wget

Download files by HTTP, HTTPS or FTP

Linux · Bash examples · commands run on the selected server

When to use wget

Use wget to save remote resources as files, including controlled retries or resumed downloads where supported. Check response errors and integrity before using a downloaded archive or replacing an important local file.

Syntax

wget [PARAMETERS] URL

Square brackets mark optional arguments; an ellipsis means repetition. Replace example file names, user names and server addresses with your own values.

Common options and arguments

-O FILE
Write the response to the specified file.
-c
Try to continue an incomplete download.
--timeout=N
Limit network wait in seconds.

Usage examples

Download page

wget -O ./page.html https://example.com

The response is saved under the selected filename, which can overwrite an existing file.

Resume a partial download

wget -c https://example.com/archive.tar.gz

A partial download is resumed if the server supports the required request behaviour.

Limit number of attempts

wget --timeout=15 --tries=2 -O ./page.html https://example.com

Connection waiting and retry count are bounded for a short retrieval attempt.

Notes and limitations

  • The server must support suitable download continuation; check the integrity of the result.
  • Don't disable TLS check without reason. -O may nullify an existing file before the request completes successfully.

Common questions and troubleshooting

Does continuing a download verify its integrity?

No. Confirm the source and compare a trusted checksum or signature after completion, especially if the remote file could have changed.

Why not disable certificate checks to fix a download?

That removes server identity verification. Correct the trust chain, hostname or system time rather than accepting an unverified connection.

Further help

Options vary by version and distribution. Check the installed documentation with this command: man wget.