]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.sbin/watch/watch.8
zfs: merge openzfs/zfs@043c6ee3b
[FreeBSD/FreeBSD.git] / usr.sbin / watch / watch.8
1 .\"
2 .Dd November 24, 2001
3 .Dt WATCH 8
4 .Os
5 .Sh NAME
6 .Nm watch
7 .Nd snoop on another tty line
8 .Sh SYNOPSIS
9 .Nm
10 .Op Fl cinotW
11 .Op Fl f Ar snpdev
12 .Op Ar tty
13 .Sh DESCRIPTION
14 The
15 .Nm
16 utility allows the user to examine all data coming through a specified tty
17 using the
18 .Xr snp 4
19 device.
20 If the
21 .Xr snp 4
22 device is not available,
23 .Nm
24 will attempt to load the module
25 .Pq Nm snp .
26 The
27 .Nm
28 utility writes to standard output.
29 .Pp
30 The options are as follows:
31 .Bl -tag -width indent
32 .It Fl c
33 Reconnect on close.
34 If the tty observed by
35 .Nm
36 is closed, automatically reattach to the same tty.
37 If this option is not specified,
38 .Nm
39 will request a new tty if running in interactive mode or exit if running
40 without a controlling tty.
41 .It Fl f Ar snpdev
42 If this option is specified,
43 .Nm
44 will use
45 .Ar snpdev
46 as the
47 .Xr snp 4
48 device.
49 Without this option,
50 .Nm
51 will attempt to find the next available
52 .Xr snp 4
53 device.
54 .It Fl i
55 Force interactive mode.
56 Interactive mode is a default if
57 .Nm
58 is started from a tty.
59 If output is redirected to a file, interactive mode can still be requested
60 by specifying this option.
61 .It Fl n
62 Disable the ability to switch the watched tty interactively.
63 This disables
64 both change requests made with <control-X> as well as automatic prompting
65 when the current tty is closed or overflows.
66 In all cases where a prompt
67 would be displayed,
68 .Nm
69 will exit.
70 The reconnect flags are unaffected by
71 this option.
72 When this flag is used, <control-X> is passed through to the terminal.
73 .It Fl o
74 Reconnect on overflow.
75 The behavior of
76 .Nm
77 if the observed tty overflows is similar to the behavior if the observed tty
78 is closed.
79 For more info see
80 .Xr snp 4 .
81 .It Fl t
82 Print the date and time when observation of a given tty is started.
83 .It Fl W
84 Allow write access to observed tty.
85 .It Ar tty
86 Tty may be specified as a tty-style device, such as a pseudo tty device,
87 a virtual console, or a serial line, etc.
88 Names may be preceded by
89 .Pa /dev/ .
90 .El
91 .Sh OPERATION
92 While running in interactive mode, all user input is discarded except for:
93 .Pp
94 .Bl -tag -width "XXXX" -compact
95 .It Sy "<control-G>"
96 Exit
97 .Nm .
98 .It Sy "<control-W>"
99 Clear screen.
100 .It Sy "<control-X>"
101 Change attached tty, unless this feature is disabled, in which case
102 control-X is passed to the terminal as with other control characters.
103 .El
104 .Sh SEE ALSO
105 .Xr pty 4 ,
106 .Xr snp 4 ,
107 .Xr kldload 8
108 .Sh HISTORY
109 The
110 .Nm
111 utility first appeared in
112 .Fx 2.1 .
113 .Sh AUTHORS
114 .An Ugen J.S. Antsilevich Aq Mt ugen@NetVision.net.il
115 .Sh BUGS
116 No terminal emulation is performed.
117 All user output is reproduced as-is.