Examples of Using Wget Command (Windows and Linux)

Wget proves that “new” doesn’t always work better. Since its release in 1996, this application has become one of the most popular download managers in the world. Almost all Linux operating systems have included Wget as the default application. The simple and simple way to use is able to perform various forms of downloading activities, such as downloading single files , entire website files , videos , large files , and so on.

This application is very simple, so for new users it doesn’t take long to use it. Just learn a few commands below to download.

In this guide we will discuss what Wget is and examples of commonly used Wget commands on Windows and Linux. Hopefully after following this guide you can use Wget to the full. Moreover, this application has many functions and benefits.

What is Wget Command?

Wget is a download manager tool that is quite simple but very useful. Developed by the GNU Project, this application is one of the best download managers at the moment. Even though it is intended for Linux, you can now use it on various operating systems: Linux, Windows, and so on.

Related to the name, Wget comes from World Wide Web Get. Of course this is in accordance with its function to download various types of files on the internet. You can also use this application offline (connected to a local network) to exchange data between computer devices.

How to Install Wget

1. Linux

How to install Wget on Linux is quite easy. You just simply open Terminal and type the following command:

  • Ubuntu
    $ sudo apt install wget
  • CentOS:
    $ sudo yum install wget
  • Fedora:
    $ sudo install install wget

2. Windows

There are several steps to install Wget on Windows, namely:

  1. Download the Wget installation file for Windows
  2. Perform the installation process
  3. Check the use of Wget
  4. (Optional) Direct the path to the program

Step 1 – Download the installation file

You can do Wget in Windows by downloading the installation file first. You can download it via the SourceForge page. You can also download it from other sites.

Step 2 – Perform the installation process

The second step is to install Wget on Windows. Just double click the installation file and follow the instructions given.

example of using wget command - install wget in windows

The Wget installation window on Windows.

Step 3 – Check the usage of Wget

Until this process, you can actually use Wget. But you have to access the folder that Wget program files use. The trick is to use Command Prompt. For example, when you download a file via a URL, the command is used like this:

“C: \ Program Files (x86) \ GnuWin32 \ bin \ wget.exe” [addressURL]

AkunURL is replaced with the URL of the file to be downloaded.

Note : Until this step, you have finished following the guide on how to install Wget on Windows. But if you want convenience when running the download process, use step 4 to set the Environment Variable .

Step 4 – (Optional) Direct the path to the program

So that you don’t need to direct the directory to the program when running the application, it is necessary to do environment variable settings first.

Access ” View Advance System Settings ” ” Environment Variable ” then edit the path to add Wget in it.

example of using wget command - wget windows configuration

Wget Configuration on Windows.

The steps above will make it easier for you when you want to use Wget. After following step 4, you can already use Wget without having to enter into the program file folder first.

example of using wget command - wget test in windows

Wget testing after PATH settings.

At this point, you can complete the Wget installation on Linux or Windows. The next review is how to use the Wget command and its various functions.

Example of Using Wget Command

Wget is not only used to download files, but also folders and can also be used to find broken links. The examples of using Wget command below are just a few examples, besides this there are still many Wget functions that you can still learn.

Here are some examples of using Wget command:

  • Saving Files with Different Names You can change the default file name of the downloaded file. In the case below, the original file is named ‘ source.zip ‘. After downloading and storing it on the local computer, the saved file name is ‘ saved_name.zip ‘. All this is because there is an “-O” option when downloading.

    $ wget -O saved_name.zip https://example.com/source.zip

  • Saving Files in a Special Directory Besides changing the file name, you can also point to the folder where the file will be saved. In the example below, the source.zip file is directed to be stored in the data folder in the document folder . The direction of this storage directory uses the “-P” option.

    $ wget -P document / data / https://example.com/source.zip

  • Downloading a Single File Downloading files that are usually done is downloading only one file. You don’t need to add an option, just type the Wget command followed by the URL address where the file is as below.

    $ wget https://example.com/source.zip

  • Downloading Multiple Direct Files Besides downloading one file, you can also download several files directly. First , create a file with any name (I use example.txt) Second , in the file enter a list of any URLs that will be downloaded. For example:

    https://example.co.id/source.zip
    https://example.com/source.zip
    https://sampel.com/yourphoto.png

    Then to execute the download process, use the option “-i” so that Wget downloads all the files above.

    $ wget -i example.txt

  • Looking for Broken Links Besides being used to download files and the like, Wget can also be used to check web pages that are not accessible (damaged). The following commands you can use.

    $ wget -o wget-log -r -1 5 –spider http://example.com

  • Limiting Download Speed Wget uses existing bandwidth to download. Sometimes this will interfere with access to other applications. You can limit the download speed with the “-limit-rate” option followed by the maximum download that can be done.

    $ wget -limit-rate = 500k https://wordpress.org/latest.zip

Those are some examples of using Wget commands that you can use. Below there are some tricks to using Wget to make it easier and maximal to use.

Some Wget Tricks

There are several options offered by Wget for the download process. If you want to see some other functions or features from Wget, use the ” man wget ” command in Terminal or ” wget -help ” in Windows. The command will display a complete guide to using Wget.

There are several Wget usage options, such as:

  • You can do the download process in the background by using the “-b” option when running the program.
  • You can use the “-t” option followed by a number (x). This option is used to conduct retry experiments up to x times if a problem occurs. This option you can use when the website or domain that is accessed is sometimes problematic.

Here are some other Wget options that you can use:

-V -Version Display the version of Wget and exit.
-h -Help Showing help.
-b -Background Go to the background after starting.
-d – debug Show lots of debugging information.
-q -Quiet Shut up (no output).
-r -Recursive Specify to download recursively.
-No-check-certificate Don’t validate the server certificate.

In addition, you can also use Wget to transfer data from one hosting server to another hosting server. Of course it will simplify the process of transferring data.

Conclusion

Through this article, you can already use some examples of using Wget command. This application, not only for downloading files, but also can be used to check the health of the website. In addition to its easy use, this application also uses little disk space.

Installing Wget on Windows is a little complicated compared to Linux. This is because Wget is an application built on Linux architecture. Just run one installation command and you can use it to download files from other devices.

Hopefully this article is enough to help you find out what Wget is and examples of using Wget command.

Leave a Reply