更新时间:2023-12-04 12:30:22
我相信这里的问题是,第一个是grep的缓冲,这意味着第二个grep的将不会看到它,直到缓冲区将刷新输出。
I believe the problem here is that the first grep is buffering the output which means the second grep won't see it until the buffer is flushed.
尝试添加 - 行缓冲
选项你的第一个grep的:
Try adding the --line-buffered
option on your first grep:
tail -f access_log | grep --line-buffered "127.0.0.1" | grep -v ".css"
有关更多信息,请参见的BashFAQ / 009 - 什么是缓冲或者说,为什么我的命令行中不产生输出:尾-f日志文件| grep的'富巴| awk的...
的
For more info, see "BashFAQ/009 -- What is buffering? Or, why does my command line produce no output: tail -f logfile | grep 'foo bar' | awk ...
"