wget
Commandwget
The wget
command is a widely used utility for non-interactive downloading of files from the web. It supports HTTP, HTTPS, and FTP protocols and can handle recursive downloads, making it very powerful for retrieving content from websites.
wget [OPTIONS] [URL]
wget
wget
has a variety of options to customize its behavior:
-V, --version
- Display version information and exit.-h, --help
- Display a help message and exit.-b, --background
- Go to background after startup.-N, --timestamping
- Don't re-download files unless newer.-P
- Set the directory prefix to directory
.-r, --recursive
- Download files recursively.-l
- Set the maximum recursion depth.-k, --convert-links
- Convert links for local viewing.-p, --page-requisites
- Download all necessary elements for HTML pages.-q, --quiet
- Turn off output.-c, --continue
- Resume a partially downloaded file.-O
- Save the downloaded file as file
.--limit-rate=
- Limit the download speed to rate
.wget
Commandwget https://example.com/file.zip
This command downloads the specified file from the provided URL.
wget -O newfile.zip https://example.com/file.zip
This command downloads the file and saves it as newfile.zip
.
wget -p https://example.com
This command downloads the specified webpage along with all the assets required to display it properly.
wget -r https://example.com/files/
This command recursively downloads all files from the specified directory.
wget --limit-rate=200k https://example.com/largefile.zip
This command limits the download speed to 200 KB/s.
The output of the wget
command includes information about the download progress, including:
Option | Description |
---|---|
-V, --version |
Display version information and exit. |
-h, --help |
Display a help message and exit. |
-b, --background |
Go to background after startup. |
-N, --timestamping |
Don't re-download files unless newer. |
-P |
Set the directory prefix to directory . |
-r, --recursive |
Download files recursively. |
-l |
Set the maximum recursion depth. |
-k, --convert-links |
Convert links for local viewing. |
-p, --page-requisites |
Download all necessary elements for HTML pages. |
-q, --quiet |
Turn off output. |
-c, --continue |
Resume a partially downloaded file. |
-O |
Save the downloaded file as file . |
--limit-rate= |
Limit the download speed to rate . |