WGET - usage tips
Examples
If you need only to download something from an url:
wget https://example.com/image.jpg
With user (cristian) and password (abc123):
wget https://example.com/document.pdf --user=cristian --password=abc123
Download from an url list (list.txt):
# list.txt
https://example.com/image1.jpg
https://example.com/image2.jpg
https://example.com/image3.jpgwget -i list.txtWhen the connection fails you can continue:
wget -c https://example.com/compressed.zipThe default number of retries is set to 20. Set the number of retries to infinity:
wget -t 0 -c https://example.com/compressed.zip
Download all files from a directory:
wget -p https://example.com/assets/img/Download files with specific extensions (.jpg, .gif, .png):
wget -nd -r -l1 -A.jpg -A.gif -A.png https://example.com/images/
(-nd no directory, -r recursive download, -l1 level 1, no subdirectories).
Shell script example
If the files are named useng a pattern (like wallpaper_1.jpg, wallpaper_2.jpg, ..., wallpaper_284.jpg, wallpaper_285.jpg) you can use a simple shell script:
#!/bin/bash for ((i = 1; i <= 285; i ++)) do wget -c "https://example.com/wallpapers/wallpaper_"$i".jpg" done
or type in a console:
for ((i = 1; i <= 285; i ++)); do wget -c "https://example.com/wallpapers/wallpaper_"$i".jpg"; done