Wget is a popular, non-interactive and widely used network downloader which supports protocols such as HTTP, HTTPS, and FTP, and retrieval via HTTP proxies. By default, wget downloads files in the current working directory where it is run.

 

Wget’s -P or --directory-prefix option is used to set the directory prefix where all retrieved files and subdirectories will be saved to.

 

In this example, we will demonstrate how to download the glances config template and store it under /etc/glances/ directory.

$ sudo mkdir /etc/glances
$ ls /etc/glances/
$ sudo wget https://raw.githubusercontent.com/nicolargo/glances/develop/conf/glances.conf -P /etc/glances/
$ ls /etc/glances/

 

If you are downloading a heavy file, you may want to add the -c or --continue flag, which means continue getting a partially-downloaded file. With it, you don’t have to start the download afresh.

 

This option helps you to resume downloading a file started by a previous instance of wget, or by another program or one that you had paused. It is also useful in case of any network failure. For example,

$ wget -c https://tenet.dl.sourceforge.net/project/parrotsecurity/iso/4.1/Parrot-security-4.1_amd64.iso

 

For more information, see the wget man page.

$ man wget 

 

Răspunsul a fost util? 0 utilizatori au considerat informația utilă (0 Voturi)