Professional Documents
Culture Documents
Windows Guide: Jump
Windows Guide: Jump
This guide will walk you through the steps for installing and using wget on Windows.
The Eye is currently sponsored by 10gbps.io. Check out their services, they’re
awesome. :)
Quick Jump:
Getting Started
Installing
Usage
- The wget help and man page
- Download a single file
- Download a folder
- Other flags worth noting
Getting Started
Wget is a command line program, this means that you use it by interacting with the
command line. The command prompt on Windows machines is called CMD .
There are two ways to get to the windows command prompt. The first is just by
searching cmd and hitting enter. The second is by hitting the Windows + r keys and
typing in cmd.exe and hitting enter.
1
Installing
Now, we will be installing wget. If you have a 64 Bit system download this file and if your
system is 32 Bit download this file.
If you downloaded wget64.exe I would suggest renaming the file to wget.exe
. This
makes it easier to use later on.
After you have downloaded the file, we need to place the file in our path. Navigate to
C:\Program Filesin Windows Explorer.
2
The folder will pop up and name it
Binaries.
3
Finally, we need to add the file to our path. You'll need to have the command prompt
open for this step.
When you have the command prompt open, you'll need to enter this
set "PATH=%PATH%;C:\Program Files/Binaries" press enter when inputted. If it
was successful, it shouldn't say anything back.
NOTE: This will only set the path temporarily, to set it permanently, follow this.
If you have followed these instructions correctly, when you type wget and hit enter in
the command prompt it will tell you wget: missing URL this means everything is
working properly!
4
NOTE: If you forgot to rename wget64.exeto
wget.exeyou will have to use
wget64instead of
wget at the command prompt.
NOTE: If you do not have administrator access you can use a different folder from
C:\Program Filesjust make sure that you also change this in the path section.
5
Using wget
This section will explain how to use wget when it's installed
If you are having an issue or want to find out how to do something new, you can almost
always find this info in the wget man page. If you want to view basic help about wget
from the command line you can enter wget -h . This will give you a list of available flags
to use and their arguments. Additionally, you can find the wget man page
[here](https://linux.die.net/man/1/wget), this is a detailed guide and can be a bit easier to
read than just wget -h .
If you want to download a single files with wget, it is typically very easy. At the
command line, enter wget '<your url here>'. This will begin your download and
show you a progress bar based on how complete the download is.
6
Wget will download files to the folder you are running the command from. If you want
wget to download to another folder there are two ways to do this
The first is by navigating there from the command prompt. To do this enter
cd <path you wantto go to>. The
cd command stands for change directory. It
is also worth noting that
cd
.. will change to the parent folder.
7
The second way it to tell wget. Do this by using the
--directory-prefix=<PATH>
flag.
Sometimes, there are lots of files in a folder you would like to download. Wget makes
doing this easy. Passing the -mor mirror flag to wget will tell it to recurse into folder
and download all the files on each flag. When you use the
-mflag it is also suggested
to use the
-npflag or no parent. This prevents wget from downloading the entire site
and going up folders. Wget will also download all the index.html files, the way to
prevent this is by using
-R 'index.html*' ,
-R means reject. Another very helpful
flag to include is the
-cflag, or continue, this will resume downloads that got
interrupted when downloading.
8
Other flags worth noting
●
-U- user agent This will set the user agent that is used when downloading,
some sites block things like wget and this will usually work to work around that by
setting them to a user agent of a valid browser.
● --no-check-certificate - Don't validate certificates If wget spits out
certificate issues, this flag will tell wget to ignore them and download anway
● -O - output Tell wget where to download a specific file, this is helpful if you want
to name the file something other than what it is on the site you're using.
● -q - quiet Download files without showing the output from the command
● -e robots=off - disable robots.txt This command disables checking the
robots.txt file. Robots.txt is used to tell crawlers what not to download, by
default wget will obey this and may leave files not downloaded. More about
robots.txt can be found here.
NOTE: Stopping Wget If you would like to stop a currently running command hit the
Control + C keys.