How to Download Files with the Linux wget Command
The wget command downloads files from the web. wget https://example.com/file.zip fetches a file into your current folder. It is a non-interactive downloader, which makes it perfect for scripts, mirrors and one-shot downloads.
Download a file
Give wget a URL. The file is saved with its original name in the current directory, with a progress bar as it downloads.
Save with a different name
Use -O to choose the output file name, which also lets you save content from a URL that has no file name.
Resume a broken download with -c
If a download fails halfway, -c (continue) picks up where it left off instead of starting over. Essential for large files on flaky connections.
Mirror a whole site with -r
Add -r to follow links and download a site recursively. This is how you pull a static site for offline use. It can fetch a lot, so add --limit-rate to be polite.
wget vs curl
wget is the simple file fetcher; curl is more flexible for APIs and custom headers. Many systems ship both. See wget for the full reference.
Keep learning
Related guides: How to Transfer Data with the Linux curl Command · How to Compress and Extract Files with tar · How to Compress and Extract Files with zip and unzip. Read all tutorials on the Learn Linux blog.