watch1
Periodically execute a command and display its output
Usage
watch [-celwx]
[-s
seconds]
command
[arg ...]
Overview
The watch utility periodically executes and displays the output of command. Differences between successive runs can be highlighted.
The options are as follows:
-
-c -
Highlight changed characters.
-
-e -
Pause updating if command exits with a non-zero exit code.
-
-l -
Highlight changed lines.
-
-s seconds -
Set the interval between updates to seconds. The default is 1 second.
-
-w -
Highlight changed words.
-
-x -
Pass command to execl(3) instead of
sh-c, for different quoting and shell escaping behaviour.
Interactive commands
Certain characters cause immediate action by watch. These are:
- ⟨
Space⟩ -
Run command again.
- ⟨
PageDown⟩ -
Scroll down a screenful.
- ⟨
PageUp⟩ -
Scroll up a screenful.
- [ | ⟨
leftarrow⟩ -
Scroll left by one column.
- ] | ⟨
rightarrow⟩ -
Scroll right by one column.
c-
Highlight changed characters.
e-
Pause command executions if the command exits with a non-zero exit code.
g-
Scroll to top.
- H
-
Scroll left half a screen.
h| ?-
Display a summary of the commands (help screen).
- J
-
Scroll down half a screen.
j| ⟨downarrow⟩-
Scroll down one line.
- K
-
Scroll up half a screen.
k| ⟨uparrow⟩-
Scroll up one line.
- L
-
Scroll right half a screen.
l-
Highlight changed lines.
r-
Display information about resource utilization.
s-
Change the update interval.
p-
Pause or resume command executions. ⟨
Space⟩ can be used while paused. w-
Highlight changed words.
q-
Quit
watch.
Releases
Unchanged in 4 releases since OpenBSD 7.8.