1 .TH WATCH 1 "2020-12-06" "procps-ng" "User Commands"
3 watch \- execute a program periodically, showing output fullscreen
6 [\fIoptions\fR] \fIcommand\fR
11 repeatedly, displaying its output and errors (the first screenfull). This
12 allows you to watch the program output change over time. By default,
13 \fIcommand\fR is run every 2 seconds and \fBwatch\fR will run until interrupted.
16 \fB\-d\fR, \fB\-\-differences\fR[=\fIpermanent\fR]
17 Highlight the differences between successive updates. If the optional
18 \fIpermanent\fR argument is specified then
20 will show all changes since the first iteration.
22 \fB\-n\fR, \fB\-\-interval\fR \fIseconds\fR
23 Specify update interval. The command will not allow quicker than 0.1 second
24 interval, in which the smaller values are converted. Both '.' and ',' work
25 for any locales. The WATCH_INTERVAL environment can be used to persistently
26 set a non-default interval (following the same rules and formatting).
28 \fB\-p\fR, \fB\-\-precise\fR
38 (if present) and notice how the fractional seconds stays (nearly) the same, as opposed to
39 normal mode where they continuously increase.
41 \fB\-t\fR, \fB\-\-no\-title\fR
42 Turn off the header showing the interval, command, and current time at the
43 top of the display, as well as the following blank line.
45 \fB\-b\fR, \fB\-\-beep\fR
46 Beep if command has a non-zero exit.
48 \fB\-e\fR, \fB\-\-errexit\fR
49 Freeze updates on command error, and exit after a key press.
51 \fB\-g\fR, \fB\-\-chgexit\fR
52 Exit when the output of
56 \fB\-c\fR, \fB\-\-color\fR
57 Interpret ANSI color and style sequences.
59 \fB\-x\fR, \fB\-\-exec\fR
66 which reduces the need to use extra quoting to get the desired effect.
68 \fB\-w\fR, \fB\-\-no\-linewrap\fR
69 Turn off line wrapping. Long lines will be truncated instead of wrapped to the next line.
71 \fB\-h\fR, \fB\-\-help\fR
72 Display help text and exit.
74 \fB\-v\fR, \fB\-\-version\fR
75 Display version information and exit.
88 Forking the process to watch failed.
91 Replacing child process stdout with write side pipe failed.
94 Command execution failed.
97 Closing child process write pipe failed.
100 IPC pipe creation failed.
103 Getting child process return value with
105 failed, or command exited up on error.
108 The watch will propagate command exit status as child exit status.
112 is affected by the following environment variables.
116 Update interval, follows the same rules as the
120 POSIX option processing is used (i.e., option processing stops at
121 the first non\-option argument). This means that flags after
123 don't get interpreted by
127 Upon terminal resize, the screen will not be correctly repainted until the
128 next scheduled update. All
130 highlighting is lost on that update as well.
132 Non-printing characters are stripped from program output. Use \fBcat -v\fR as
133 part of the command pipeline if you want to see them.
135 Combining Characters that are supposed to display on the character at the
136 last column on the screen may display one column early, or they may not
139 Combining Characters never count as different in
141 mode. Only the base character counts.
143 Blank lines directly after a line which ends in the last column do not
147 mode doesn't yet have advanced temporal distortion technology to compensate
155 also can get into a state where it rapid-fires as many executions of
157 as it can to catch up from a previous executions running longer than
161 taking ages on a DNS lookup).
164 To watch for mail, you might do
168 To watch the contents of a directory change, you could use
172 If you're only interested in files owned by user joe, you might use
174 watch \-d 'ls \-l | fgrep joe'
176 To see the effects of quoting, try these out
182 watch echo "'"'$$'"'"
184 To see the effect of precision time keeping, try adding
190 You can watch for your administrator to install the latest kernel with
196 isn't guaranteed to work across reboots, especially in the face of
198 (if present) or other bootup time-changing mechanisms)