Updated with Tizen:Base source codes
[external/procps.git] / watch.1
1 .TH WATCH 1 "1999 Apr 3" " " "Linux User's Manual"
2 .SH NAME
3 watch \- execute a program periodically, showing output fullscreen
4 .SH SYNOPSIS
5 .B watch
6 .I [\-dhvt] [\-n <seconds>] [\-\-differences[=cumulative]] [\-\-help] [\-\-interval=<seconds>] [\-\-no\-title] [\-\-version] <command>
7 .SH DESCRIPTION
8 .BR watch
9 runs
10 .I command
11 repeatedly, displaying its output (the first screenfull).  This allows you to
12 watch the program output change over time.  By default, the program is run
13 every 2 seconds; use 
14 .I -n
15 or
16 .I --interval
17 to specify a different interval.
18 .PP
19 The
20 .I -d
21 or
22 .I --differences
23 flag will highlight the differences between successive updates.  The 
24 .I --cumulative
25 option makes highlighting "sticky", presenting a running display of all
26 positions that have ever changed.  The
27 .I -t
28 or
29 .I --no-title
30 option turns off the header showing the interval, command, and current
31 time at the top of the display, as well as the following blank line.
32 .PP
33 .BR watch
34 will run until interrupted.
35 .SH NOTE
36 Note that
37 .I command
38 is given to "sh -c"
39 which means that you may need to use extra quoting to get the desired effect.
40 .PP
41 Note that POSIX option processing is used (i.e., option processing stops at
42 the first non-option argument).  This means that flags after
43 .I command
44 don't get interpreted by
45 .BR watch
46 itself.
47 .SH EXAMPLES
48 .PP
49 To watch for mail, you might do
50 .IP
51 watch \-n 60 from
52 .PP
53 To watch the contents of a directory change, you could use
54 .IP
55 watch \-d ls \-l
56 .PP
57 If you're only interested in files owned by user joe, you might use 
58 .IP
59 watch \-d 'ls \-l | fgrep joe'
60 .PP
61 To see the effects of quoting, try these out
62 .IP
63 watch echo $$
64 .IP
65 watch echo '$$'
66 .IP
67 watch echo "'"'$$'"'"
68 .PP
69 You can watch for your administrator to install the latest kernel with
70 .IP
71 watch uname -r
72 .PP
73 (Just kidding.)
74 .SH BUGS
75 Upon terminal resize, the screen will not be correctly repainted until the
76 next scheduled update.  All
77 .I --differences
78 highlighting is lost on that update as well.
79 .PP
80 Non-printing characters are stripped from program output.  Use "cat -v" as
81 part of the command pipeline if you want to see them.
82 .SH AUTHORS
83 The original
84 .B watch
85 was written by Tony Rems <rembo@unisoft.com> in 1991, with mods and
86 corrections by Francois Pinard.  It was reworked and new features added by
87 Mike Coleman <mkc@acm.org> in 1999.