Download a File
wget https://example.com/files/app-1.4.2.tar.gzThe file is saved under its own name in the current folder, with a progress bar while it downloads. If wget is missing, install it: sudo apt install wget on Debian and Ubuntu, sudo dnf install wget on AlmaLinux and Rocky Linux. Debian, Ubuntu, AlmaLinux, and Rocky Linux ship GNU Wget 1.x. Fedora installs Wget2 under the name wget; it accepts the common options below but has no FTP or WARC support. wget --version shows which one you have.
Common Options
| Option | What it does |
|---|---|
-O name | Saves under another name |
-P dir | Saves into a folder |
-c | Resumes a partial download |
-q | Quiet: no output |
-b | Runs in the background |
--limit- | Caps speed at 2 MB/s |
-i list.txt | Downloads every URL in a file |
--tries= | Tries up to five times |
--timeout= | Gives up on a stalled connection |
Save Under Another Name
wget -O app.tar.gz https://example.com/files/app-1.4.2.tar.gz
wget -P /srv/downloads https://example.com/files/app-1.4.2.tar.gzNote the capital O: lowercase -o writes wget's own messages to a log file instead.
Resume and Retry
wget -c --tries=5 --timeout=30 https://example.com/files/large.isoIf a large download stops, run the same command with -c in the same folder: wget continues from where the file ends, provided the server supports partial downloads; otherwise it starts again from the beginning. The default is 20 tries, and errors such as 404 or a refused connection are not retried. If the file on the server has changed since the first attempt, delete the partial copy instead of resuming.
Limit the Rate and Run in the Background
wget -b --limit-rate=2m https://example.com/files/large.iso
tail -f wget-logA rate limit keeps a big download from slowing down the sites on the same server. With -b, wget moves to the background at once and, unless you set a log file with -o, writes its progress to wget-log in the current folder. For other long commands, see the nohup command.
Download a List of Files
wget -c -i urls.txt --wait=1Put one URL per line in urls.txt. --wait=1 pauses one second between files.
Mirror Your Own Site
Mirror only sites you own or have permission to copy, and keep the load low:
wget --mirror --convert-links --adjust-extension --page-requisites \
--no-parent --wait=1 --limit-rate=500k https://example.com/This copies the pages and the files they need into a folder named after the domain, with links rewritten to work offline. --mirror turns on unlimited recursion and timestamping, and wget follows the site's robots.txt while it crawls. It gives you the site as visitors see it, not its database or source code, so it does not replace a backup.
Verify Before You Use a File
Compare the file with the checksum the publisher lists before you unpack or run anything:
sha256sum app-1.4.2.tar.gz
sha256sum -c app-1.4.2.tar.gz.sha256The second form reads the expected value from a checksum file and prints OK or FAILED. If the project publishes a signature, check that too. Then unpack it; see how to extract tar.gz files.
Never Pipe a Download into a Shell
A line such as wget -qO- URL | sh runs whatever the server sends, with your rights, before anyone has read it. Download the script to a file, read it, verify it, and then run it.
Errors and wget vs curl
- 404 Not Found or 403 Forbidden: the URL is wrong or the file is not public.
- Certificate errors: update
ca-certificatesand check the server clock. Turning off certificate checks is not the fix.
wget is built for downloading files and folders; curl is better at talking to APIs. See how to download a file with curl.
Updated:
Linux VPS with Full Root Access
MUVCloud cloud servers run on KVM with Enterprise NVMe SSD storage and full root access, in Turkey, the Netherlands, and the USA.
More Guides
No Limits on Service or Support
You are not on your own as your projects grow. Our support engineers are ready 24/7, on several channels, whenever you need them.

- 100% customer satisfaction goal
- Our own hardware
- 24/7 ticket and email support
- 4 countries with locations