79776194

Date: 2025-09-26 16:43:44
Score: 0.5
Natty:
Report link

@OP It's not clear what you have against the suggestion of @nick-odell. He seems to have posted a very helpful link in his comment. I think I can see why Multitail from that link would not do exactly what you want, but as far as I can see its top answer, https://unix.stackexchange.com/a/337779, would. This uses GNU Parallel, which should be available to install from the standard repositories of most distributions.

That answer, made by user @cartoonist, stated that the command-line option --line-buffer was in alpha testing. That was 8 years ago, and things have obviously moved on, because parallel(1) no longer labels it as such.

My own adaption of that answer for your situation would be to use something like:

parallel --tagstring {/}: --line-buffer tail -f {} ::: * | sed -e '/str[12]/d'  -e 's/\t//'

Some bits of explanation about this:

(Slightly to my surprise, I found that the above command, as written, does not need shell metacharacters to be quoted and even handles filenames containing spaces. Must be to do with Parallel being a - rather large - Perl script which must slurp the command line and process it itself, rather than leaving that up to the shell.)

Reasons:
  • Long answer (-1):
  • Has code block (-0.5):
  • User mentioned (1): @nick-odell
  • User mentioned (0): @cartoonist
  • Low reputation (1):
Posted by: felis margarita