Tell me more ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Is there a utility that I can stick in a pipeline to decouple read and write speeds?

$ producer | buf | consumer

Basically, I want a utility buf that reads its input as fast as possible, storing it in memory so consumer can take its sweet time while producer runs as fast as possible.

share|improve this question

3 Answers

The pv (pipe viewer) utility can do this (with the -B option) and a lot more, including giving you progress reports.

share|improve this answer

you can use dd:

producer | dd bs=64K | consumer

It's available on every unix.

share|improve this answer
+1 for using standard utility, although pv is probably is probably nicer to use (shows progress). – Totor Mar 17 at 15:17

Take a look at mbuffer. It can buffer to memory or memory mapped file(-t/-T).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.