Add a big buffer to a pipe between two commands

后端 未结 5 1876
灰色年华
灰色年华 2020-12-29 03:14

Given a bash command line of the form

commandA | commandB

I want to add a buffer of size ~1MB that sits between commandA and <

5条回答
  •  粉色の甜心
    2020-12-29 04:13

    You can use

    • buffer (mentioned)
    • mbuffer (works on solaris too, possibly other UNIXes)

    E.g.

        process1 | mbuffer -m 1024M | process2
    

    to use a 1G buffer

提交回复
热议问题