# How to use the Linux wget command to download files from the internet

By using the [Linux command](https://www.ionos.ca/digitalguide/server/configuration/linux-commands-an-overview-of-terminal-commands/ "Linux commands: An overview of terminal commands") wget you can start the program of the same name and download files from the internet. This command gives you plenty of options to optimize the process as well.

## What is the Linux wget command?

wget is an important tool on [Linux](https://www.ionos.ca/digitalguide/server/know-how/linux-the-cost-effective-alternative-to-windows/ "Linux – the cost-effective alternative to Windows") systems if you want to **download files from the internet**. The program allows you to download content directly from your terminal. First released in 1996 and managed by the GNU project wget is a free tool that comes as standard on most [Linux distributions](https://www.ionos.ca/digitalguide/server/configuration/linux-distributions/ "Linux distributions") such as [Debian](https://www.ionos.ca/digitalguide/server/know-how/debian-the-universal-system-software/ "Debian – the universal system software") or [Ubuntu](https://www.ionos.ca/digitalguide/server/know-how/ubuntu-the-linux-system-for-everyone/ "Ubuntu: The Linux system for everyone"). You can initiate downloads by using the wget command. Downloads are supported by [FTP](https://www.ionos.ca/digitalguide/server/know-how/file-transfer-protocol/ "File Transfer Protocol")-, [HTTP](https://www.ionos.ca/digitalguide/hosting/technical-matters/what-is-http/ "What is HTTP?") and [HTTPS](https://www.ionos.ca/digitalguide/hosting/technical-matters/what-is-https/ "What is HTTPS?") servers.

If you don’t have wget on your Linux system, you can install it by using the following command:

```shell
$ sudo apt-get install wget
```

## How does the wget command work?

You can use the wget command to download a file from the internet. Files are automatically **saved in your current work folder**. The download won’t take place interactively. This means that processes can be carried out even when you’re not logged in. This option is also used to restart a download that was previously stopped.

## What does the wget syntax look like?

Once you’ve installed Linux wget, you can use the command to download content. This is what the syntax looks like:

```shell
$ wget [Option] [URL]
```

You can also modify wget through different options. If you want to download multiple files you can list the corresponding URLs and simply separate them with a space.

## What options does the wget command have?

There are numerous options for wget. These are the most common:

- **-c or --continue:** Continues a previously interrupted download.
- **-N:** Will only download a file if it’s newer than a file of the same name on your computer.
- **-t \[amount\]:** Sets how many times Linux wget will try to download a file.
- **-w \[time\]:** Sets how many seconds wget will wait between multiple downloads.

## Examples of a wget command

Finally we will show you how you can use wget. Here are a few examples:

```shell
$ wget http://example.ca/folder/file
```

This is how you can download a file.

```shell
$ wget -c http://example.ca/folder/file
```

And with this command you can restart a download.

```shell
$ wget -t 5 http://example.ca/folder/file
```

In this example wget will attempt to download the file five times. If these five attempts aren’t successful, the download will fail.


This is a markdown version of: [https://www.ionos.ca/digitalguide/server/configuration/linux-wget-command/](https://www.ionos.ca/digitalguide/server/configuration/linux-wget-command/) for AI/LLM consumption.