------------------------------------------------------------------------------------- / _ \ \_\(_)/_/ _//"\\_ JOHLEM.net / \ https://johlem.net/V1/topics/cheatsheet.php ------------------------------------------------------------------------------------- --- WGET #Wget Command to Download Single Files wget https://wordpress.org/latest.zip #Wget Command to Download Multiple Files wget -i example.txt (example.txt contains link you want to download) #Wget Command to Get Files Under Different Names wget -O wordpress-install.zip https://wordpress.org/latest.zip #Wget Command to Save Files in Specified Directory wget -P /home/documents/mybinaries/ https://wordpress.org/latest.zip #Wget Command to Limit Download Speed wget --limit-rate=500k https://wordpress.org/latest.zip #Wget Command to Set Retry Attempts wget -tries=100 https://wordpress.org/latest.zip #Wget Command to Download in Background (check the log file to see the progress ((tail -f wget-log)) wget -b http://example.com/beefy-file.tar.gz #Wget Command to Continue Interrupted Downloads wget -c https://example/very-big-file.zip #Wget Command to Retrieve Whole Websites wget --mirror --convert-links --page-requisites --no-parent -P documents/websites/ https://wordpress.org/ #Wget Command to Download Numbered Files wget http://example.com/images/{1..50}.jpg Wget Command to Locate Broken Links wget -o wget-log -r -l 5 --spider http://example.com -o Gathers output into a file for later use. -l Specifies the recursion level. -r Makes the download recursive. –spider Sets wget to spider mode. How To Use wget With Username and Password for FTP / HTTP File Retrieval wget options url wget --user=NAME --password='PASSWORD' url wget --user=NAME --password='PASSWORD' ftp://url/path/file.name wget --user=NAME --password='PASSWORD' http://url/path/file.name wget --user=johlem --ask-password http://johlem.net/protected/area/foo.pdf How do I read username and password from a file? Create a ~/.wgetrc file. The syntax is as follows to store login credentials: $ cat ~/.wgetrc user=bob password=azerty ======================== wget -c -b -tries=100 --limit-rate=500k -P /home/bob/Desktop/TOTO -O gentoo.iso https://bouncer.gentoo.org/fetch/root/all/releases/amd64/autobuilds/20211018T200943Z/install-amd64-minimal-20211018T200943Z.iso