OpenBSD manual page server

Manual Page Search Parameters

WATCH(1) General Commands Manual WATCH(1)

watchperiodically execute a command and display its output

watch [-celwx] [-s seconds] command [arg ...]

The watch utility periodically executes and displays the output of command. Differences between successive runs can be highlighted.

The options are as follows:

Highlight changed characters.
Pause updating if command exits with a non-zero exit code.
Highlight changed lines.
seconds
Set the interval between updates to seconds. The default is 1 second.
Highlight changed words.
Pass command to execl(3) instead of sh -c, for different quoting and shell escaping behaviour.

Certain characters cause immediate action by watch. These are:

Space
Run command again.
Page Down
Scroll down a screenful.
Page Up
Scroll up a screenful.
| ⟨left arrow
Scroll left by one column.
| ⟨right arrow
Scroll right by one column.
Highlight changed characters.
Pause command executions if the command exits with a non-zero exit code.
Scroll to top.
Scroll left half a screen.
|
Display a summary of the commands (help screen).
Scroll down half a screen.
| ⟨down arrow
Scroll down one line.
Scroll up half a screen.
| ⟨up arrow
Scroll up one line.
Scroll right half a screen.
Highlight changed lines.
Display information about resource utilization.
Change the update interval.
Pause or resume command executions. ⟨Space⟩ can be used while paused.
Highlight changed words.
Quit watch.

sh(1), getrusage(2), execl(3)

watch was first published in 1991 and has been available since OpenBSD 7.8.

Takuya Sato, Kazumasa Utashiro, YASUOKA Masahiko <yasuoka@openbsd.org>, and Job Snijders <job@openbsd.org>.

June 27, 2025 OpenBSD-current