A download quota keeps one wget run from consuming more disk or bandwidth than the job can afford. That matters most for URL lists, recursive pulls, and unattended fetches where the total size is not obvious before the command starts.
GNU wget enforces this cap with --quota or -Q. The quota is checked after each file completes, not during the transfer, so the current file is allowed to finish even when it pushes the session past the configured budget.
That end-of-file behavior is the main operational caveat. A single large file can exceed the quota by itself, and setting the value to 0 or inf removes the limit entirely, so keep quota-controlled runs in their own directory and verify the actual bytes written before chaining the output into another task.
Steps to limit total download size in wget:
- Create an isolated working directory and write the target URLs to one input file.
$ mkdir -p ~/transfers/wget-quota/export-run-01 $ cd ~/transfers/wget-quota/export-run-01 $ cat > urls.txt <<'EOF' https://downloads.example.net/exports/catalog-064k.bin https://downloads.example.net/exports/inventory-delta-096k.bin https://downloads.example.net/exports/media-index-160k.bin EOF
One directory per quota run keeps the manifest, payloads, and later verification in the same place.
- Run wget with a total transfer cap and let the last file finish even if it crosses the limit.
$ wget --quota=200k --input-file=urls.txt --directory-prefix=payloads ##### snipped ##### Saving to: 'payloads/catalog-064k.bin' 2026-03-29 09:23:16 (7.81 MB/s) - 'payloads/catalog-064k.bin' saved [65536/65536] ##### snipped ##### Saving to: 'payloads/inventory-delta-096k.bin' 2026-03-29 09:23:16 (8.94 MB/s) - 'payloads/inventory-delta-096k.bin' saved [98304/98304] ##### snipped ##### Saving to: 'payloads/media-index-160k.bin' 2026-03-29 09:23:16 (10.2 MB/s) - 'payloads/media-index-160k.bin' saved [163840/163840] FINISHED --2026-03-29 09:23:16-- Downloaded: 3 files, 320K in 0.03s (10.4 MB/s) Download quota of 200K EXCEEDED!
Quota never truncates a file mid-transfer, so the final total can exceed the configured value when the last completed file exhausts the budget.
- Use the short -Q form when the same quota logic needs a compact flag in shell wrappers.
$ wget -Q 50m --input-file=urls.txt --directory-prefix=quota-050m $ wget -Q 500m --input-file=urls.txt --directory-prefix=quota-500m
-Q and --quota are equivalent, so choose the form that reads most clearly in the surrounding script.
- Check the actual bytes on disk instead of assuming the configured quota is a hard ceiling.
$ du -sh payloads 320K payloads $ ls -lh payloads total 320K -rw-r--r-- 1 user user 64K Mar 29 09:23 catalog-064k.bin -rw-r--r-- 1 user user 96K Mar 29 09:23 inventory-delta-096k.bin -rw-r--r-- 1 user user 160K Mar 29 09:23 media-index-160k.bin
The directory size is the real post-run result that downstream tooling has to handle.
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
