1
.TH WATCH 1 "2010 Mar 01" " " "Linux User's Manual"
1
.TH WATCH "1" "June 2011" "procps-ng" "User Commands"
3
3
watch \- execute a program periodically, showing output fullscreen
12
.RB [ \-\-differences[=\fIcumulative\fP]]
16
.RB [ \-\-interval=\fIseconds\fP]
6
[\fIoptions\fR] \fIcommand\fR
25
11
repeatedly, displaying its output and errors (the first screenfull). This
27
watch the program output change over time. By default, the program is run
32
to specify a different interval. Normally, this interval is interpreted
33
as the amout of time between the completion of one run of
35
and the beginning of the next run. However, with the
12
allows you to watch the program output change over time. By default, the
13
program is run every 2 seconds.
16
will run until interrupted.
19
\fB\-d\fR, \fB\-\-differences\fR [\fIpermanent\fR]
20
Highlight the differences between successive updates. Option will read
21
optional argument that changes highlight to be permanent, allowing to see what
22
has changed at least once since first iteration.
24
\fB\-n\fR, \fB\-\-interval\fR \fIseconds\fR
25
Specify update interval. The command will not allow quicker than 0.1 second
26
interval, in which the smaller values are converted.
28
\fB\-p\fR, \fB\-\-precise\fR
45
35
seconds. Try it with
47
and notice how the fractional seconds stays
48
(nearly) the same, as opposed to normal mode where they continuously
55
flag will highlight the differences between successive updates. Using
56
.B \-\-differences=\fIcumulative\fP
57
makes highlighting "sticky", presenting a running display of all
58
positions that have ever changed. The
62
option turns off the header showing the interval, command, and current
63
time at the top of the display, as well as the following blank line. The
67
option causes the command to beep if it has a non-zero exit.
70
will normally run until interrupted. If you want
72
to exit on an error from the program running use the
76
options, which will cause
78
to exit if the return value from the program is non-zero.
80
By default \fBwatch\fR will normally not pass escape characters, however
81
if you use the \fI\-\-c\fR or \fI\-\-color\fR option, then
82
\fBwatch\fR will interpret ANSI color sequences for the foreground.
37
and notice how the fractional seconds stays (nearly) the same, as opposed to
38
normal mode where they continuously increase.
40
\fB\-t\fR, \fB\-\-no\-title\fR
41
Turn off the header showing the interval, command, and current time at the
42
top of the display, as well as the following blank line.
44
\fB\-b\fR, \fB\-\-beep\fR
45
Beep if command has a non-zero exit.
47
\fB\-e\fR, \fB\-\-errexit\fR
48
Freeze updates on command error, and exit after a key press.
50
\fB\-g\fR, \fB\-\-chgexit\fR
51
Exit when the output of
55
\fB\-c\fR, \fB\-\-color\fR
56
Interpret ANSI color sequences.
58
\fB\-x\fR, \fB\-\-exec\fR
62
which means that you may need to use extra quoting to get the desired effect.
63
This with the \-\-exec option, which passes the command to
67
\fB\-h\fR, \fB\-\-help\fR
68
Display help text and exit.
70
\fB\-v\fR, \fB\-\-version\fR
71
Display version information and exit.
88
which means that you may need to use extra quoting to get the desired effect.
89
You can disable this with the
93
option, which passes the command to exec(2) instead.
95
73
Note that POSIX option processing is used (i.e., option processing stops at
96
74
the first non\-option argument). This means that flags after
172
150
taking ages on a DNS lookup).
163
Forking the process to watch failed.
166
Replacing child process stdout with write side pipe failed.
169
Command execution failed.
172
Closign child process write pipe failed.
175
IPC pipe creation failed.
178
Getting child process return value with
180
failed, or command exited up on error.
183
The watch will propagate command exit status as child exit status.
176
was written by Tony Rems <rembo@unisoft.com> in 1991, with mods and
188
.UR rembo@\:unisoft.\:com
191
in 1991, with mods and
177
192
corrections by Francois Pinard. It was reworked and new features added by
178
Mike Coleman <mkc@acm.org> in 1999. The beep, exec, and error handling
179
features were added by Morty Abzug <morty@frakir.org> in 2008.
180
On a not so dark and stormy morning
181
in March of 2003, Anthony DeRobertis <asd@suespammers.org> got sick of
182
his watches that should update every minute eventually updating many
183
seconds after the minute started, and added microsecond precision.
184
Unicode support was added in 2009 by Jarrod Lowe <procps@rrod.net>.
196
in 1999. The beep, exec, and error handling features were added by
197
.UR morty@\:frakir.\:org
200
in 2008. On a not so dark and stormy morning in March of 2003,
201
.UR asd@\:suespammers.\:org
204
got sick of his watches that should update every minute eventually updating
205
many seconds after the minute started, and added microsecond precision.
206
Unicode support was added in 2009 by
207
.UR procps@\:rrod.\:net