What is use for Wget Command?
wget utility is the best option to download files from internet.
wget can pretty much handle all complex download situations including large file downloads, recursive downloads, non-interactive downloads, multiple file downloads etc.
Some of the examples for how to download using wget
1) How to download a single file with using wget
$ wget http://www.openss7.org/repos/tarballs/strx25-0.9.2.1.tar.bz2
The above example downloads a single file from internet and stores in the current directory.
2) How to download and store with a different File name Using wget -O
$ wget -O taglist.zip http://www.vim.org/scripts/download_script.php?src_id=7701
3) How to Specify Download Speed / Download Rate Using wget –limit-rate
$ wget --limit-rate=200k http://www.openss7.org/repos/tarballs/strx25-0.9.2.1.tar.bz2
In the above example, the download speed is limited to 200k.
4) How to Continue the Incomplete Download Using wget -c
$ wget -c http://www.openss7.org/repos/tarballs/strx25-0.9.2.1.tar.bz2
5) How to Download in the Background Using
wget -b
$ wget -b http://www.openss7.org/repos/tarballs/strx25-0.9.2.1.tar.bz2
6) How to Test Download URL Using wget –spider
$ wget --spider DOWNLOAD-URL
7)How to Increase Total Number of Retry Attempts Using wget –tries
$ wget --tries=75 DOWNLOAD-URL
8) How to Download Multiple Files / URLs Using Wget -i
First, store all the download files or URLs in a text file as:
$ cat > download-file-list.txt
URL1
URL2
URL3
URL4
Next, give the download-file-list.txt as argument to wget using -i option
as shown below.
$ wget -i download-file-list.txt
9)How to Download a Full Website Using wget –mirror
$ wget --mirror -p --convert-links -P ./LOCAL-DIR WEBSITE-URL
10) How to Quit Downloading When it Exceeds Certain Size Using wget -Q
$ wget -Q5m -i FILE-WHICH-HAS-URLS
11)FTP Download With wget
$ wget --ftp-user=USERNAME --ftp-password=PASSWORD DOWNLOAD-URL
12)How to Reject Certain File Types while Downloading Using wget –reject
$ wget --reject=gif WEBSITE-TO-BE-DOWNLOADED
13)Log messages to a log file instead of stderr Using wget -o
$ wget -o download.log DOWNLOAD-URL