wget is a common command on Linux used to download files to the computer with different protocols. wget
present in most linux distros with their respective package managers. But in windows we need to download and install wget
by hand.
Join the channel Telegram belong to AnonyViet 👉 Link 👈 |
Command Prompt (CMD) in Windows 10 does not have enough features like Termimal on Linux. To make up for its shortcomings, tools like wget and Cygwin can be installed on Windows to get the most out of Command Prompt.
In this guide, AnonyViet will see how to download, install and set up wget
windows 7, 8, 10, server, etc… For more information on how to use wget, see the following instructions.
Install wget on Windows to Download File
The wget command allows you to Download FIle via TCP/IP protocols: FTP, HTTP and HTTPS. If you are a Linux or Mac user, wget is already included in the official distro version. Unfortunately, wget is not available on Windows. To run WGET, you need to download, extract, and install it manually.
Download wget to Windows
Download from Sourceforge
Sourceforge provides support for a wide variety of free and open source projects. wget
is one of them. You can download wget versions on Windows from the following links: https://sourceforge.net/projects/gnuwin32/files/wget/1.11.4-1/
Download from Eternallybored
Eternallybored.org is a website that provides binaries of the GNU project. I recommend downloading wget from Eternallybored because it has x86 and x64 versions, and is updated regularly. You can download wget from the following links:
https://eternallybored.org/misc/wget/
Install wget on Windows
Currently wget supports both Windows 7 and Windows 10, so it is compatible with the latest operating systems. After downloading the wget file, you will get the wget.exe file.
Now we will create the folder wget put it in the path: C:\Program Files\
So we will get the reference C:\Program Files\wget
Now copy the file wget.exe
into the folder C:\Program Files\wget
Next, you need to add the path of wget.exe to the environment variable on Windows. This will add the wget file path to the PATH variable used to determine the location of the wget file. Each time you call the wget command, just type wget without having to type the path C:\Program Files\wget\wget.exe
. You do the following:
Right click This Computer select Properties select Advanced System Settings -> Advanced -> Environment Variables -> System variables.
Look down to find the line path -> Edit -> New type path C:\Program Files\wget
select OK
Now open CMD with administrator rights and type wget. If you see the message wget: missing URL, it is successful.
Now try downloading the file with direct link using wget. The command to download using wget on Windows is
wget địa-chỉ-link-cần-download
For example If you want to download the iso file of Kali Linux using wget, type the command
wget https://cdimage.kali.org/kali-2020.1b/kali-linux-2020.1b-installer-amd64.iso
So we can use the linux wget command on Windows quickly.
How to use wget command
wget has many properties, usually we only use wget on windows to download a certain file. But you don't know that wget also has many cool features like Downloading the entire Website. Below are some wget commands on Windows to help you save time to Download File:
DOWNLOAD A SINGLE FILE
wget http://website.com/file.zip
DOWNLOAD A SINGLE FILE BUT SAVE AS A DIFFERENT NAME
wget ‐‐output-document=newname.html website.com
DOWNLOAD A SPECIFIC FOLDER
wget ‐‐directory-prefix=folder/subfolder website.com/file.zip
CONTINUE DOWNLOADING PREVIOUSLY INTERRUPTED FILES
wget ‐‐continue website.com /file.zip
DOWNLOAD THE NEWER VERSION OF THE FILE
wget ‐‐continue ‐‐timestamping website.com/file.zip
DOWNLOAD MANY WEBSITES
For this parameter, you need to create a list in Notepad or another text editor. Add a new full URL (with http://) on a separate line. Then point wget to the file. In this example, I named the file Filelist.txt and saved it in the wget folder.
wget ‐‐input Filelist.txt
DOWNLOAD THE ENTIRE WEBSITE
wget ‐‐execute robots=off ‐‐recursive ‐‐no-parent ‐‐continue ‐‐no-clobber http://website.com
You can try to fake these user agent by impersonating Googlebot. Try typing this:
wget –user-agent="Googlebot/2.1 (+http://www.googlebot.com/bot.html)" -r http://website.com
DOWNLOAD A SPECIFIC FILE TYPE FROM A WEBSITE
wget ‐‐level=1 ‐‐recursive ‐‐no-parent ‐‐accept FILETYPE http://website.com / FILETYPE/
For example, change FILETYPE to MP3, MP4, .zip or whatever you like.
DOWNLOAD ALL WEBSITE IMAGES
wget ‐‐directory-prefix=files/pictures ‐‐no-directories ‐‐recursive ‐‐no-clobber ‐‐accept jpg,gif,png,jpeg http://website.com/images/
CHECK A WEBSITE FOR BROKEN LINKS
wget ‐‐output-file=logfile.txt ‐‐recursive ‐‐spider http://website.com
UPLOAD FILES WITHOUT OVERLOADING THE WEB SERVER
wget ‐‐limit-rate=20k ‐‐wait=60 ‐‐random-wait ‐‐mirror http://website.com
There are hundreds, if not thousands, of wget commands and AnonyViet lists them here. Now you are familiar with the tool and how it works, depending on what you use it for!