Useful wget commands
wget is a very handful utility to download files over the internet. It can handle most of the scenarios like background download,multiple downloads,non interactive downloads etc. we can look at useful options wget provides.
http://example.com/file.html
http://example.com/file2.html
....
....
Download a file:
wget http://example.com/sample.zip
Save or Write wget output to file
wget -o log.txt http://example.com/sample.zip
Continue from last location
wget -c http://example.com/sample.zipIt can be useful when downloading large file.
Download file in the background
wget http://example.com/sample.zip &
Download multiples files
wget -i download-urls.txtdownload-urls.txt contains links like this:
http://example.com/file.html
http://example.com/file2.html
....
....
Specify number of Retry attempts
wget -t=3 http://example.com/sample.zip
Download full website using wget
wget --mirror -p --convert-links -P ./LOCAL-DIR WEBSITE-URL
Download only specific files from the url
wget -r --accept "*.jpg" http://example.com/sample.zip
Comments (0)