# Linux – How to rate-limit a pipe under linux

linuxpipe

Is there a filter which I could use to rate-limit a pipe on linux? If this exists, let call it rate-limit, I want to be able to type in a terminal something like

cat /dev/urandom | rate-limit 3 -k | foo


in order to send a a stream of random bytes to foo's standard input at a rate (lower than) 3 kbytes/s.

cat /dev/urandom | pv -L 3k | foo