Downloading Files with WGET

Rashmin Mudunkotuwa
3 min readMar 26, 2021
Image by CHUTTERSNAP on Unsplash

Before I get into the main topic of my article let me introduce you to WGET. Wget is commonly used computer program which is used to download content from web servers via the command line interface. You can install wget via a simple terminal command.

// Ubuntusudo apt-get install wget// Fedora Based Systemsyum install wget

And you are done !

Now you can copy the download link of any file you need an perform a simple,

wget https://download.link.com/file.extention

It is simple as it gets. But inside wget there are a whole lot of extra options which you can pass in as command line parameters which are intended for several purposes. Who can find all the options in the wget documentation.

Recently I got a chance to work with a remote server while configuring it and installing software in it. While I was amidst setting up the development environment, a small problem came up, I had to download some database binaries from the Oracle web site. And as any rational personal would do I just right clicked on the download link and used the ever-useful wget command to download the file.

sudo wget https://download.somefile.com/file.zip

And when I looked into the downloaded file, it was only 3 kilo bytes, but should have been a multiple gigabyte file. So after some investigation I found out that Oracle asks for a license agreement when you click on the download button, and the original download link is never shown in the browser.

Screenshot by Author — License agreement

After wasting some time on browsing the internet about this, I found this video which gave a pretty simple solution to this.

Here what happens is the original download link of the file is never shown in the browser itself so we cannot right click on the link and copy url and be done with it. Here what you have to do is follow the normal procedure on your browser and click the download button and let the browser start the download.

As soon as the download starts, pause the download in your browser

Screenshot by Author — Download Screen

And right click on the link shown under the file name and select copy link address. If you look at that address you will see that it is different than the original address we copied in vain.

Now you can open a terminal and use that address with wget and see the magic happening !

Since I saw this kind of downloads in several websites like Oracle Database and Oracle Java Download and much more, I think this article has helped you in anyway.

Leave a comment if you have any question. :-)

--

--

Rashmin Mudunkotuwa

Software Engineer | Interested in Cloud Computing, Microservices, API Development, and Software as a whole.