Wednesday, December 16, 2009

Useful wget commands

Useful wget commands

$wget -r http://example.com/packages/
Download all files in the directory of packages and fabricate all the structure of the site, http://example.com

$wget -r -np -nd http://example.com/packages/
The same as above, but don't recursive for parent directory (-np), don't reconstruct directory structure in local machine (-nd)

$wget -i filename.txt
filename.txt includes all needed download address, then wget would automatically download all file

wget -c http://example.com/really-big-file.iso
the option -c means wget would resume last download process in the case the last download didn't finish

wget -m -k (-H) http://www.example.com/
mirror a site, and convert the links in the mirror automatically. -H enable across site recursive retrieving