summaryrefslogtreecommitdiff
path: root/static/openbsd/man1/watch.1
blob: 72d956bb0e845a766c30b9b68417412a370a460b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
.\"	$OpenBSD: watch.1,v 1.15 2025/06/27 05:42:51 jmc Exp $
.\"
.\" Copyright (c) 2000, 2001, 2014, 2016 Internet Initiative Japan Inc.
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: June 27 2025 $
.Dt WATCH 1
.Os
.Sh NAME
.Nm watch
.Nd periodically execute a command and display its output
.Sh SYNOPSIS
.Nm
.Op Fl celwx
.Op Fl s Ar seconds
.Ar command Op Ar arg ...
.Sh DESCRIPTION
The
.Nm
utility periodically executes and displays the output of
.Ar command .
Differences between successive runs can be highlighted.
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl c
Highlight changed characters.
.It Fl e
Pause updating if
.Ar command
exits with a non-zero exit code.
.It Fl l
Highlight changed lines.
.It Fl s Ar seconds
Set the interval between updates to
.Ar seconds .
The default is 1 second.
.It Fl w
Highlight changed words.
.It Fl x
Pass
.Ar command
to
.Xr execl 3
instead of
.Ic sh -c ,
for different quoting and shell escaping behaviour.
.El
.Sh INTERACTIVE COMMANDS
Certain characters cause immediate action by
.Nm .
These are:
.Bl -tag -width Ds
.It Aq Ic Space
Run
.Ar command
again.
.It Aq Ic Page Down
Scroll down a screenful.
.It Aq Ic Page Up
Scroll up a screenful.
.It Ic \&[ | Aq Ic left arrow
Scroll left by one column.
.It Ic \&] | Aq Ic right arrow
Scroll right by one column.
.It Ic c
Highlight changed characters.
.It Ic e
Pause command executions if the command exits with a non-zero exit code.
.It Ic g
Scroll to top.
.It Ic H
Scroll left half a screen.
.It Ic h | Ic \&?
Display a summary of the commands (help screen).
.It Ic J
Scroll down half a screen.
.It Ic j | Aq Ic down arrow
Scroll down one line.
.It Ic K
Scroll up half a screen.
.It Ic k | Aq Ic up arrow
Scroll up one line.
.It Ic L
Scroll right half a screen.
.It Ic l
Highlight changed lines.
.It Ic r
Display information about resource utilization.
.It Ic s
Change the update interval.
.It Ic p
Pause or resume command executions.
.Aq Ic Space
can be used while paused.
.It Ic w
Highlight changed words.
.It Ic q
Quit
.Nm .
.El
.Sh SEE ALSO
.Xr sh 1 ,
.Xr getrusage 2 ,
.Xr execl 3
.Sh HISTORY
.Nm
was first published in 1991 and has been available since
.Ox 7.8 .
.Sh AUTHORS
.An -nosplit
.An Takuya Sato ,
.An Kazumasa Utashiro ,
.An YASUOKA Masahiko Aq Mt yasuoka@openbsd.org ,
and
.An Job Snijders Aq Mt job@openbsd.org .