AMZ DIGICOM

Digital Communication

AMZ DIGICOM

Digital Communication

Linux wget command: download files from the Internet

PARTAGEZ

The Linux wget command allows you to activate the program of the same name, and thus download files from the Internet. It also offers many options to optimize the process.

Linux wget command: what is it?

The Linux wget command is an essential tool if you are looking to download files from internet. The latter allows you to download them directly from your terminal. This program first saw the light of day in 1966, and it has been regularly updated ever since. The wget element is free and pre-installed by default in most Linux distributions, such as Debian or Ubuntu. You can start downloading the desired content using the wget command. All downloads from FTP, http and HTTPS servers are supported.

If the Linux wget command is not already built into your system, you can install it using the following command

$ sudo apt-get install wget

shell

How does the wget command work?

The wget command is used to download a file from the Internet. This is then saved in the current working directory, automatically. The download is not interactive; such an operation can thus be carried out even if you are not connected. You also have the possibility to resume a suspended download using the option provided for this purpose.

What does the wget command syntax look like?

If you have the Linux wget command installed, you can use it to download content. Its syntax is as follows:

$ wget [Option] [URL]

shell

You can use options to modify the wget command. Want to download different files? Feel free to make a list of matching URLs, remembering to separate them with spaces.

What are the wget command options?

The Linux wget command has many options. You will find the most important of them below:

  • -c or –continue: it allows resuming a suspended download.
  • -NOT : if a file of the same name already exists on your computer, it ensures that the file in question is downloaded only if it is newer than this one.
  • -t [nombre] : it allows you to set the number of times the Linux wget command should attempt to download the file.
  • -w [durée]: in case of multiple downloads, it is used to define the number of seconds which must separate two downloads.

wget Command: Examples

Finally, we’ll show you how to use the wget command yourself. Below are some examples:

$ wget http://exemple.fr/dossier/fichier

shell

This command allows you to download a file.

$ wget -c http://exemple.fr/dossier/fichier

shell

This command allows you to resume a suspended download.

$ wget -t 5 http://exemple.fr/dossier/fichier

shell

With this command, five attempts to download the file in question will be made. If these are not sufficient, the action is then interrupted.

Télécharger notre livre blanc

Comment construire une stratégie de marketing digital ?

Le guide indispensable pour promouvoir votre marque en ligne

En savoir plus

Souhaitez vous Booster votre Business?

écrivez-nous et restez en contact