Is that possible to use grep
on a continuous stream?
(可以在连续流上使用grep
吗?)
What I mean is sort of a tail -f <file>
command, but with grep
on the output in order to keep only the lines that interest me.
(我的意思是有点tail -f <file>
命令,但是在输出中使用grep
以便仅保留我感兴趣的行。)
I've tried tail -f <file> | grep pattern
(我已经试过tail -f <file> | grep pattern
)
tail -f <file> | grep pattern
but it seems that grep
can only be executed once tail
finishes, that is to say never. (tail -f <file> | grep pattern
但似乎只能在tail
完成后才执行grep
,也就是说永远不会执行。)
ask by Matthieu Napoli translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…