How to ‘grep’ a continuous stream?
Turn on grep‘s line buffering mode when using BSD grep (FreeBSD, Mac OS X etc.) tail -f file | grep –line-buffered my_pattern It looks like a while ago –line-buffered didn’t matter for GNU grep (used on pretty much any Linux) as it flushed by default (YMMV for other Unix-likes such as SmartOS, AIX or QNX). … Read more