Limiting a specific shell's internet bandwidth usage

Have a look at trickle a userspace bandwidth shaper. Just start your shell with trickle and specify the speed, e.g.:

trickle -d 100 zsh

which tries to limit the download speed to 100KB/s for all programs launched inside this shell.

As trickle uses LD_PRELOAD this won't work with static linked programs but this isn't a problem for most programs.


http://lartc.org/wondershaper/

It is in Ubuntu / Debian repositories, probably others too. It limits not just a single shell, but the whole machine. Never tried it myself though


The man page for wget provides the following information:

 --limit-rate=amount

Limit the download speed to amount bytes per second. Amount may be expressed in bytes, kilobytes with the k suffix, or megabytes with the m suffix. For example, --limit-rate=20k will limit the retrieval rate to 20KB/s. This is useful when, for whatever reason, you don't want Wget to consume the entire available bandwidth.