How to install wget in Windows?
Step 1: Download wget.exe file from net.
Step 1: Download wget.exe file from net.
Step 2: Add the location where this file is saved in the path variable.
Step 3: Go to command prompt and type wget.
How to install wget in Linux?
In linux, wget will be installed by default. If not, do yum search and install the latest version
>yum search wget
>yum install wget.XXXX
How to download a file from web using wget command?
wget [OPTIONS] [URL]
The below command will download the page from google and save it google.html file. The \ is line separator in Linux. In windows ^ is a line separator.
wget --quiet \
--timeout=30 \
--dns-timeout=30 \
--connect-timeout=30 \
--read-timeout=30 \
--tries=5 \
--waitretry=5 \
--timestamping \
--output-document google.html \
Here are some of the interesting options in wget.
- timeout - Specify timeout
- dns-timeout - Dns lookup timeout
- connect-timeout - connection timeout
- read-timeout - reading timeout
- tries - how many times it should try to download
- waitretry - how many times it should retry to download
- timestaming - Don’t download if it is newer than the local file.
- output-document - save the download page in this file
- quiet - Don’t output log
- verbose - output the log
- ftp-user - username of the ftp server, if you download using ftp protocol.
- ftp-password - password of the ftp user