Try this (you'll need to install multitail
):
multitail -du -t "$(head -n 1 filename)" filename
or, for headers longer than one line:
multitail -wh 2 -l "head -n 2 filename" filename
If you want to follow command output instead of a file:
multitail -wh 2 -l "command | head -n 2" -l command
or use -t
as appropriate. Note that you may need to use unbuffer
so your command output appears immediately.
You can use -D
to disable the display of status lines for the -wh
forms (it would defeat the purpose of the -t
form).