wget (World Wide Web Get)
wget is a free utility for non-interactive download of files from the Web. It supports HTTP, HTTPS, and FTP protocols. Its background operation and auto-resume capabilities make it perfect for downloading large files or entire websites.
1. Basic Usage
wget [options] [URL]
2. Key Options
| Option | Name | Description |
|---|---|---|
-O [file] |
Output | Saves the downloaded file with a specific name. |
-c |
Continue | Resumes a partially-downloaded file. |
-b |
Background | Goes to background immediately after startup. |
-r |
Recursive | Turns on recursive retrieving. |
-m |
Mirror | Turns on options suitable for mirroring a website. |
-w [sec] |
Wait | Wait a specific number of seconds between retrievals. |
3. Practical Examples
① Downloading a file and renaming it
wget -O my_script.sh https://example.com/s1.sh
② Downloading in the background
Check progress later using tail -f wget-log.
wget -b https://example.com/big-movie.mp4
③ Limiting download speed
Avoid choking the network for other users:
wget --limit-rate=200k https://example.com/file.zip
4. [Tip] Recursive Safety
When using wget -r, always use it with caution to avoid downloading unwanted gigabytes of data. Using -l [depth] (limit level) or -np (no-parent) is highly recommended to keep the scope narrow.