How to 'grep' a continuous stream?

前端 未结 12 1499
清酒与你
清酒与你 2020-11-22 11:15

Is that possible to use grep on a continuous stream?

What I mean is sort of a tail -f command, but with grep on t

12条回答
  •  迷失自我
    2020-11-22 11:17

    I think that your problem is that grep uses some output buffering. Try

    tail -f file | stdbuf -o0 grep my_pattern
    

    it will set output buffering mode of grep to unbuffered.

提交回复
热议问题