2014-02-25 00:29:46 +08:00
|
|
|
# wget
|
|
|
|
|
2016-01-07 18:31:27 +01:00
|
|
|
> Download files from the Web.
|
|
|
|
> Supports HTTP, HTTPS, and FTP.
|
2019-06-03 02:06:36 +02:00
|
|
|
> More information: <https://www.gnu.org/software/wget>.
|
2014-02-25 00:29:46 +08:00
|
|
|
|
2021-08-15 19:59:09 +02:00
|
|
|
- Download the contents of a URL to a file (named "foo" in this case):
|
2014-02-25 00:29:46 +08:00
|
|
|
|
2017-09-27 15:27:59 +01:00
|
|
|
`wget {{https://example.com/foo}}`
|
2014-02-25 00:29:46 +08:00
|
|
|
|
2021-08-15 19:59:09 +02:00
|
|
|
- Download the contents of a URL to a file (named "bar" in this case):
|
2017-12-06 11:45:26 +01:00
|
|
|
|
2021-05-04 09:25:49 +02:00
|
|
|
`wget --output-document {{bar}} {{https://example.com/foo}}`
|
2017-12-06 11:45:26 +01:00
|
|
|
|
2019-02-27 01:45:47 +03:30
|
|
|
- Download a single web page and all its resources with 3-second intervals between requests (scripts, stylesheets, images, etc.):
|
2014-02-25 00:29:46 +08:00
|
|
|
|
2019-02-27 01:45:47 +03:30
|
|
|
`wget --page-requisites --convert-links --wait=3 {{https://example.com/somepage.html}}`
|
2014-02-25 00:29:46 +08:00
|
|
|
|
2018-01-09 01:29:24 -07:00
|
|
|
- Download all listed files within a directory and its sub-directories (does not download embedded page elements):
|
|
|
|
|
|
|
|
`wget --mirror --no-parent {{https://example.com/somepath/}}`
|
|
|
|
|
2019-02-27 01:45:47 +03:30
|
|
|
- Limit the download speed and the number of connection retries:
|
|
|
|
|
|
|
|
`wget --limit-rate={{300k}} --tries={{100}} {{https://example.com/somepath/}}`
|
|
|
|
|
|
|
|
- Download a file from an HTTP server using Basic Auth (also works for FTP):
|
2014-02-25 00:29:46 +08:00
|
|
|
|
2019-02-27 01:45:47 +03:30
|
|
|
`wget --user={{username}} --password={{password}} {{https://example.com}}`
|
2014-02-25 00:29:46 +08:00
|
|
|
|
2017-09-27 15:27:59 +01:00
|
|
|
- Continue an incomplete download:
|
2014-02-25 00:29:46 +08:00
|
|
|
|
2021-05-04 09:25:49 +02:00
|
|
|
`wget --continue {{https://example.com}}`
|
2016-05-15 21:49:44 +08:00
|
|
|
|
2019-02-27 01:45:47 +03:30
|
|
|
- Download all URLs stored in a text file to a specific directory:
|
2016-05-15 21:49:44 +08:00
|
|
|
|
2021-05-04 09:25:49 +02:00
|
|
|
`wget --directory-prefix {{path/to/directory}} --input-file {{URLs.txt}}`
|