Watch

From LQWiki
Jump to: navigation, search

watch is a command to observe the output of a command as it is repeated over time. The terminal is filled with the output as it updates.

Defaults:

  • keeps repeating until the program is interrupted.
  • inteval of 2 seconds

Options

  • -d --differences [permanent]
 Highlights differences since the last update, or from the beginning.
  • -n --interval seconds
 Sets the update interval
  • -p --precise
 Tries hard to keep the interval precise (see [ntptime])
  • -t --no-title
 Turn off the header.
  • -b --beep
 Beep if command has a non-zero exit code.
  • -e --errorexit
 Freeze updates if the command has a non-zero exit code, and exit on any key press.
  • -g --chgexit
 Exit when the output changes
  • -c --color
 Interpret ANSI color sequences
  • -x --exec
 Command is given to [sh] -c (requires special quoting)
  • -h --help
 Display hellp and exit
  • -v --version
 Display version and exit