The wget Command
wget is the simple file downloader. Point it at a URL, get a file.
Basic Download
Progress bar included by default. File saves to current directory.
Specify Output Name
Resume Interrupted Download
-c (continue) is perfect for large files over unreliable connections.
Download in Background
-b runs in background. Check wget-log for progress.
Quiet Mode
-q suppresses all output - useful in scripts.
Download Multiple Files
From a list:
Limit Speed
Be polite to servers, or avoid saturating your connection.
wget vs curl
| Feature | wget | curl |
|---|---|---|
| Download files | Excellent | Good |
| Resume downloads | Yes (-c) | Yes |
| Recursive download | Yes | No |
| API testing | Limited | Excellent |
| HTTP methods | GET mainly | All |
| Scripting output | Basic | Flexible |
When to Use Which
- wget: Downloading files
- curl: API testing, flexible HTTP requests
Both can download. wget is simpler, curl is more powerful.
Common Use Cases
Download Software Release
Download Script and Run
-O - outputs to stdout instead of file.
Piping to bash
Be careful with | bash. Only do this from trusted sources. You're running arbitrary code.
How do you resume an interrupted wget download?
Quick Reference
| Flag | Purpose |
|---|---|
-O file | Output to specific file |
-c | Continue/resume download |
-b | Background download |
-q | Quiet (no output) |
-i file | Download URLs from file |
--limit-rate=X | Limit bandwidth |
Key Takeaways
wget URLdownloads a file-cresumes interrupted downloads-O filenamespecifies output name-qfor quiet scripting- Use wget for downloads, curl for APIs
Next: checking open ports and connections.