7.1 Simple Usage
- Say you want to download a url. Just type:
- But what will happen if the connection is slow, and the file is lengthy?
The connection will probably fail before the whole file is retrieved,
more than once. In this case, Wget will try getting the file until it
either gets the whole of it, or exceeds the default number of retries
(this being 20). It is easy to change the number of tries to 45, to
insure that the whole file will arrive safely:
wget --tries=45 http://fly.srk.fer.hr/jpg/flyweb.jpg
- Now let's leave Wget to work in the background, and write its progress
to log file log. It is tiring to type ‘--tries’, so we
shall use ‘-t’.
wget -t 45 -o log http://fly.srk.fer.hr/jpg/flyweb.jpg &
The ampersand at the end of the line makes sure that Wget works in the
background. To unlimit the number of retries, use ‘-t inf’.
- The usage of ftp is as simple. Wget will take care of login and
- If you specify a directory, Wget will retrieve the directory listing,
parse it and convert it to html. Try: