How to Limit Download Speed in Ubuntu Terminal
This article provides a quick guide on restricting bandwidth usage while downloading files on Ubuntu systems. You will learn how to use standard command-line tools to set a maximum download speed, ensuring your network remains stable for other tasks during large transfers.
Using Wget to Limit Rate
The most common tool for downloading files in Ubuntu is
wget. It includes a built-in flag to cap the download
speed. Open your terminal and use the --limit-rate option
followed by your desired speed.
wget --limit-rate=500k http://example.com/large-file.zipIn this example, the download speed is capped at 500 kilobytes per
second. You can specify different units by appending a letter to the
number. Use k for kilobytes, m for megabytes,
or g for gigabytes. For instance,
--limit-rate=1m restricts the speed to one megabyte per
second.
Using Curl to Limit Rate
If you prefer using curl, it offers similar
functionality. The syntax is slightly different but achieves the same
result of limiting the rate per host connection.
curl --limit-rate 500K -O http://example.com/large-file.zipNote that curl accepts units like K,
M, or G. This command ensures that the
transfer does not exceed the specified bandwidth threshold, preventing
the host connection from saturating your network link.
Verifying the Download
Once the command executes, observe the terminal output. The progress bar will update at a pace consistent with your limit. If the speed exceeds your setting, check your command syntax for errors. This method effectively manages bandwidth without requiring additional software installation on your Ubuntu machine.