You can use viddy
.
It's a binary that has the basic features of original watch command, including color output and diff highlight, but allows scroll and has a couple more cool features including text search and time machine mode, which allows one go back to the previous versions of the output.
The current one-liner to install it is
wget -O viddy.tar.gz https://github.com/sachaos/viddy/releases/download/v0.3.6/viddy_0.3.6_Linux_x86_64.tar.gz && tar xvf viddy.tar.gz && sudo mv viddy /usr/local/bin
And then you can use it like, for example
viddy -d -n 1 ls dir/
to list the dir every second and to highlight the changes. While viddy is running, press ?
to get the keyboard shortcuts.
viddy
cmd options:
$ viddy -h
Usage:
viddy [options] command
Options:
-b, --bell ring terminal bell changes between updates
-d, --differences highlight changes between updates
-n, --interval <interval> seconds to wait between updates (default "2s")
-p, --precise attempt run command in precise intervals
-c, --clockwork run command in precise intervals forcibly
-t, --no-title turn off header
--shell shell (default "sh")
--shell-options additional shell options
--unfold unfold command result
--pty run on pty (experimental, not for Windows)
screen
command withwatch
mycommand
, I use a bash loop:while : ; do mycommand; sleep 2; done
instead ofwatch mycommand
.