How to Control Download Speed Using Wget in Ubuntu

  • Post category:Ubuntu

When downloading large files using Wget, controlling the download speed can help you avoid hogging your network’s bandwidth, ensuring smooth operation of other applications. This is especially useful in shared network environments or when you’re multitasking online.

In this post, we’ll show you how to limit download speeds with Wget using the --limit-rate option.

Setting the Download Speed with Wget

Wget’s --limit-rate option allows you to specify the maximum download speed. You can set the speed in bytes, kilobytes, megabytes, or gigabytes, depending on your requirements.

Basic Syntax

To limit the download speed, use the following command:

wget --limit-rate=[rate] [URL]
  • Replace [rate] with the desired speed.
  • Replace [URL] with the link to the file you want to download.

Examples

  1. Limiting Download to 50 KB/s:
    To limit your download speed to 50 kilobytes per second, use the following command:
   wget --limit-rate=50k https://example.com/file.zip
  1. Limiting Download to 1 MB/s:
    To set a download speed limit of 1 megabyte per second, you can use:
   wget --limit-rate=1M https://example.com/file.zip
  1. Limiting to 5 MB/s:
    For 5 megabytes per second, the command will look like this:
   wget --limit-rate=5M https://example.com/file.zip

Using Other Units

Wget supports different units for specifying the rate:

  • Bytes per second: No suffix (e.g., 200 for 200 bytes).
  • Kilobytes per second: Add k (e.g., 50k for 50 KB).
  • Megabytes per second: Add M (e.g., 1M for 1 MB).
  • Gigabytes per second: Add g (e.g., 1g for 1 GB).

Combining with Other Options

You can also combine the --limit-rate option with other Wget flags to customize your downloads. For instance, using the quiet mode (-q) to suppress output:

wget -q --limit-rate=100k https://example.com/file.zip

This command limits the download to 100 kilobytes per second and runs in quiet mode.

Conclusion

By setting a speed limit using Wget’s --limit-rate option, you can easily manage your bandwidth usage, allowing other applications to function without interruption. This is a great way to keep your network balanced when downloading large files.

For more tips and tutorials on Ubuntu and Wget, stay tuned to codeallow.com