1 .TH WATCH "1" "June 2011" "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, 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
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.
73 Note that POSIX option processing is used (i.e., option processing stops at
74 the first non\-option argument). This means that flags after
76 don't get interpreted by
81 To watch for mail, you might do
85 To watch the contents of a directory change, you could use
89 If you're only interested in files owned by user joe, you might use
91 watch \-d 'ls \-l | fgrep joe'
93 To see the effects of quoting, try these out
101 To see the effect of precision time keeping, try adding
107 You can watch for your administrator to install the latest kernel with
113 isn't guaranteed to work across reboots, especially in the face of
115 or other bootup time-changing mechanisms)
117 Upon terminal resize, the screen will not be correctly repainted until the
118 next scheduled update. All
120 highlighting is lost on that update as well.
122 Non-printing characters are stripped from program output. Use "cat -v" as
123 part of the command pipeline if you want to see them.
125 Combining Characters that are supposed to display on the character at the
126 last column on the screen may display one column early, or they may not
129 Combining Characters never count as different in
131 mode. Only the base character counts.
133 Blank lines directly after a line which ends in the last column do not
137 mode doesn't yet have advanced temporal distortion technology to compensate
144 also can get into a state where it rapid-fires as many executions of
146 as it can to catch up from a previous executions running longer than
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.
188 .UR rembo@\:unisoft.\:com
191 in 1991, with mods and
192 corrections by Francois Pinard. It was reworked and new features added by
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