Live program output monitoring tool

command linemonitoring

I would like to know if there is a tool that would enable you to watch how the program output changes live. Something like tail -f but instead of monitoring the file changes, it would repeatedly call some executable and display it live.

For example, if the tool is caled foobar and I would call foobar 'ps -Al', it would behave kind of like top – displaying the output in real time.

Best Answer

Try watch. From the manpage:

Name

watch - execute a program periodically, showing output fullscreen

Synopsis

watch [-dhvt] [-n <seconds>] [--differences[=cumulative]] [--help] [--interval=<seconds>] [--no-title] [--version] <command>

Description

watch runs command repeatedly, displaying its output (the first screenfull). This allows you to watch the program output change over time. By default, the program is run every 2 seconds; use -n or --interval to specify a different interval.

The -d or --differences flag will highlight the differences between successive updates. The --cumulative option makes highlighting "sticky", presenting a running display of all positions that have ever changed. [...]

watch will run until interrupted.

Note that "realtime" would have to be approximated by "once a second" (for example) here...

Related Question