Powered by coANDco UK

Howto get a website or a file via command line (wget)

From How2s

The programm "wget" lets you fetch files from the internet via command line


wget "http://www.google.com/search?hl=de&q=man+wget&btnG=Suche&lr="
(get a page)
wget "http://www.kernel.org/pub/linux/kernel/v2.6/patch-2.6.10.bz2"
(get a file)
wget -r -x how2s.org
(get all files of a domain and save them in a directory)
wget --delete-after "http://www.google.com/search?hl=de&q=man+wget&btnG=Suche&lr="
(delete the file after downloading)
wget -m -np http://www.domain.tld/folder/
get all contents from folder and follow links, mirror on local drive (e.g. for mirroring a apache directory listing)

make sure, you do not forget the quotes arount the file, so all parameters will be submitted.

more information can be found in the manual files

man wget
Please check out our sponsor, thanks to whom How2s.org is FREE: