version: 1.11.4
download from: http://users.ugent.be/~bpuype/wget/
Basic options
Display all help: wget --help
Completely mirror a site: wget -mr http://...
-m: mirror
-r: recursive
Mirror without following links to other servers, parent directories: wget -mrnp http://...
-np: no-parent
Retrieve a html file and convert relative links to absolute ones: wget -k http://users.ugent.be/~bpuype/wget
-k: 'k'onvert links
Resume partially downloaded files (if supported by the server): wget -c http://...
-c: continue
Read url's from a file and retrieve them: wget -i file_with_urls.txt
-i: input-file
Ask for url's (read from stdin): wget -i -. Enter url's on the command line, press enter after each url, and terminate with ^Z (press CTRL-Z) on an empty line.
FTP
--glob=off
Don't treat (, *, ? etc. as globbing characters. Use when transfering files with names that contain these characters.
--passive-ftp
Use passive mode for data connection (try this if you're behind a firewall, NAT box...)
Proxy
To make wget use a proxy, you must set up an environment variable before using wget. Type this at the command prompt:
set http_proxy=http://proxy.myprovider.net:8080
...where you use the correct proxy hostname and port for your ISP or network. You can use ftp_proxy to proxy ftp requests.
--proxy=on
--proxy=off
Turn proxy usage on/off once variable is set; default is on when variable is present.
Passwords
To retrieve with passwords (http or ftp), you can use the following url syntax:
wget http://username:password@www.example.net/somedir/somefile
wget ftp://username:password@ftp.example.net/somedir/somefile
Additionally, you can also use --http-user, --http-password as well as --ftp-user, --ftp-password:
wget ftp://ftp.example.net/somefile --ftp-user=username --ftp-password=password
If username or password contain non-alphanumeric characters, you need to escape them when passing them in urls (rfc1738 %HH) syntax. For example, with a username of user@domain and password of pass, your url becomes http://user%40domain:pass@www.example.net/somefile. When using escaped urls in batch files, remember that % itself is a special character, and needs to be escaped itself (by using %% instead of %).