wget is a common command on Linux used to Download Files to the computer with different protocols. wget
present in most linux distro distributions 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 tutorial.
Install wget on Windows to Download File
The wget command allows you to Download FIle over TCP/IP: FTP, HTTP and HTTPS. If you are a Linux or Mac user, wget is already built into 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 lot of free and open source projects. wget
is one of them. You can Download Windows versions of wget 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 on Windows 7 to 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 directory wget put it in the path: C:\Program Files\
Thus we will get the lead C:\Program Files\wget
Now copy the file wget.exe
go to 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 whole path C:\Program Files\wget\wget.exe
. You do the following:
Right click on 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 is successful.
Now try to Download the file with direct link using wget. The command to download using wget on Windows is
wget địa-chỉ-link-cần-download
Eg If you want to download the kali linux iso file with 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 the wget . command
wget has a lot of properties, usually we only use wget on windows to download a certain file. But you do not know that wget also has a lot of cool features like Download the Website. Here are some wget commands on Windows to save you time to download files:
DOWNLOAD ONE FILE
wget http://website.com/file.zip
DOWNLOAD ONE FILE BUT SAVE ANOTHER NAME
wget ‐‐output-document=newname.html website.com
DOWNLOAD A SPECIFIC DIRECTORY
wget ‐‐directory-prefix=folder/subfolder website.com/file.zip
CONTINUE DOWNLOAD PREVIOUS FILE DISTRIBUTED
wget ‐‐continue website.com /file.zip
DOWNLOAD LATEST VERSION OF FILE
wget ‐‐continue ‐‐timestamping website.com/file.zip
DOWNLOAD MULTIPLE SITES
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 SITE
wget ‐‐execute robots=off ‐‐recursive ‐‐no-parent ‐‐continue ‐‐no-clobber http://website.com
You can try to fake the 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 TYPE OF FILE FROM A SITE
wget ‐‐level=1 ‐‐recursive ‐‐no-parent ‐‐accept FILETYPE http://website.com / FILETYPE/
For example, change the FILETYPE for MP3, MP4, .zip or whatever you like.
DOWNLOAD ALL SITE IMAGES
wget ‐‐directory-prefix=files/pictures ‐‐no-directories ‐‐recursive ‐‐no-clobber ‐‐accept jpg,gif,png,jpeg http://website.com/images/
CHECK A SITE FOR DAMAGED LINKS
wget ‐‐output-file=logfile.txt ‐‐recursive ‐‐spider http://website.com
DOWNLOAD 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 and AnonyViet commands listed here. Now that you’re familiar with this tool and how it works, it’s up to you what you use it for!