Linux Command Reference: wget
wget retrieves files over HTTP or FTP.
Using wget
Usage: wget <options> <TARGET_URL> (where <TARGET_URL> is a valid HTTP or FTP resource)
wget Options
Logging
- -q - "Quiet" mode (no text output)
- -v - "Verbose" mode (display errors, download status)
Input
- --input-file=<FILENAME> - Use <FILENAME> as a source for URL's to download (treat as a list of URL's)
- --force-html - Used with --input-file, treats input file as an HTML document
Output
- --output-file=<FILENAME> - Write output to <FILENAME>
- --append-output=<FILENAME> - Append output to <FILENAME>
Download
- --tries=<NUMBER> - wget should try <NUMBER> times to download the target whether or not the connection is refused (0 = infinite)
- --continue - Resume download on a partially-completed download
- -nc - "No clobber" (do not overwrite local files if they already exist)
- --timestamping - Do not retrieve files unless they are newer than locally-stored files
Recursive Download
- --recursive - Download recursively (all documents linked on the site will be downloaded)
- --accept=<COMMA_SEPARATED_EXTENSION_LIST> - The <COMMA_SEPARATED_EXTENSION_LIST> of file extensions will be accepted for download
- --reject=<COMMA_SEPARATED_EXTENSION_LIST> - The <COMMA_SEPARATED_EXTENSION_LIST> of file extensions will not be downloaded
Download a List of Files
Create a text file (using nano for example), with the URLs of the files you want to download. One URL per line.
Then issue this command:
wget -i filename.ext
Help and Manual
Enter wget --help to view the Help file or enter man wget to view the Manual for wget.