2014-02-24 16:29:46 +00:00
|
|
|
# wget
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
> Download files from the Web.
|
|
|
|
> Supports HTTP, HTTPS, and FTP.
|
2019-06-03 01:06:36 +01:00
|
|
|
> More information: <https://www.gnu.org/software/wget>.
|
2014-02-24 16:29:46 +00:00
|
|
|
|
2017-09-27 15:27:59 +01:00
|
|
|
- Download the contents of an URL to a file (named "foo" in this case):
|
2014-02-24 16:29:46 +00:00
|
|
|
|
2017-09-27 15:27:59 +01:00
|
|
|
`wget {{https://example.com/foo}}`
|
2014-02-24 16:29:46 +00:00
|
|
|
|
2017-12-06 10:45:26 +00:00
|
|
|
- Download the contents of an URL to a file (named "bar" in this case):
|
|
|
|
|
|
|
|
`wget -O {{bar}} {{https://example.com/foo}}`
|
|
|
|
|
2019-02-26 22:15:47 +00:00
|
|
|
- Download a single web page and all its resources with 3-second intervals between requests (scripts, stylesheets, images, etc.):
|
2014-02-24 16:29:46 +00:00
|
|
|
|
2019-02-26 22:15:47 +00:00
|
|
|
`wget --page-requisites --convert-links --wait=3 {{https://example.com/somepage.html}}`
|
2014-02-24 16:29:46 +00:00
|
|
|
|
2018-01-09 08:29:24 +00: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-26 22:15:47 +00:00
|
|
|
- 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-24 16:29:46 +00:00
|
|
|
|
2019-02-26 22:15:47 +00:00
|
|
|
`wget --user={{username}} --password={{password}} {{https://example.com}}`
|
2014-02-24 16:29:46 +00:00
|
|
|
|
2017-09-27 15:27:59 +01:00
|
|
|
- Continue an incomplete download:
|
2014-02-24 16:29:46 +00:00
|
|
|
|
2017-09-27 15:27:59 +01:00
|
|
|
`wget -c {{https://example.com}}`
|
2016-05-15 14:49:44 +01:00
|
|
|
|
2019-02-26 22:15:47 +00:00
|
|
|
- Download all URLs stored in a text file to a specific directory:
|
2016-05-15 14:49:44 +01:00
|
|
|
|
2019-02-26 22:15:47 +00:00
|
|
|
`wget -P {{path/to/directory}} -i {{URLs.txt}}`
|