We need to track a status file that is rewritten every few seconds by a server process. The watch
command works beautifully for this (i.e. watch cat file.txt
), except now the table is several pages long (even on a rotated wide-screen display). We have a dedicated display/monitor that runs this command continuously and we need to be able to scroll up and down the file to find pertinent status values.
I will also note that we are not running screen
or tmux
since we have dedicated the entire monitor to this status file.
I've searched on the topic (with the best discussion here) but none of the code works on our system (Ubuntu 20). For example:
swatch
runs and scrolls, but after a few minutes the text gets shredded with each update and becomes unreadablepwatch
flickers so badly its not watchable (thewatch
command by itself has perfectly smooth updates)watch "cat file | tail -n $(($LINES - 2))"
has a static offset and does not scrollwatchall
does not actually scroll (I think there iscurses
error also)
So now I'm posing the question again. Has anyone found a scrollable version of watch
that will work on Ubuntu?
Thanks.
watch 'cmd | pr -t2'
or run withinscreen
with a screen size bigger than the host terminal's – Stéphane Chazelas Dec 15 '21 at 21:15