wget: Simple Usage

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