如何‘GREP’一个连续的溪流?这能用吗grep在一条连续不断的小溪上?我的意思是tail -f <file>命令,但是grep为了保持我感兴趣的线条。我试过tail -f <file> | grep pattern但似乎grep只能执行一次tail完成了,也就是说永远不会。
3 回答

HUX布斯
TA贡献1876条经验 获得超6个赞
grep
tail -f file | grep --line-buffered my_pattern

有只小跳蛙
TA贡献1824条经验 获得超8个赞
tail -f /var/log/some.log |grep foo
--line-buffered
tail -f /var/log/some.log | grep --line-buffered foo | grep bar
添加回答
举报
0/150
提交
取消