xref: /freebsd/usr.sbin/watch/watch.8 (revision 5521ff5a4d1929056e7ffc982fac3341ca54df7c)
1.\"
2.\" @(#)watch.8		1.1 (FreeBSD) 2/17/95
3.\" $FreeBSD$
4.\"
5.Dd February 17, 1995
6.Dt WATCH 8
7.Os
8.Sh NAME
9.Nm watch
10.Nd snoop on another tty line
11.Sh SYNOPSIS
12.Nm
13.Op Fl ciotnW
14.Op Ar tty
15.\"  watch [-ciotnW] [<tty name>]
16.Sh DESCRIPTION
17.Nm Watch
18allows the superuser to examine all data coming through a specified tty.
19.Nm Watch
20writes to standard output.
21.Pp
22The options are as follows:
23.Bl -tag -width indent
24.It Fl c
25Reconnect on close.  If the tty observed by
26.Nm
27is closed,  automatically reattach to the same tty.
28If this option is not specified,
29.Nm
30will request a new tty if running in interactive mode or exit if running
31without a controlling tty.
32.It Fl i
33Force interactive mode.
34Interactive mode is a default if
35.Nm
36is started from a tty.
37If output is redirected to a file, interactive mode can still be requested
38by specifying this option.
39.It Fl o
40Reconnect on overflow.
41The behavior of
42.Nm
43if the observed tty overflows is similar to the behavior if the observed tty
44is closed.
45For more info see
46.Xr snp 4 .
47.It Fl t
48Print the date and time when observation of a given tty is started.
49.It Fl n
50Disable the ability to switch the watched tty interactively.  This disables
51both change requests made with <control-X> as well as automatic prompting
52when the current tty is closed or overflows.  In all cases where a prompt
53would be displayed,
54.Nm
55will exit.  The reconnect flags are unaffected by
56this option.
57.It Fl W
58Allow write access to observed tty.
59.It Ar tty
60Tty may be specified as an tty-style device, such as a pseudo tty device,
61a virtual console, or a serial line, etc.
62Names may be preceded by
63.Pa /dev/ .
64.El
65.Sh OPERATION
66While running in interactive mode, all user input is discarded except for:
67.Pp
68.Bl -tag -width "XXXX" -compact
69.It Sy "<control-G>"
70Exit
71.Nm .
72.It Sy "<control-W>"
73Clear screen.
74.It Sy "<control-X>"
75Change attached tty.
76.El
77.Sh RESTRICTIONS
78Only the superuser can run
79.Nm .
80.Sh SEE ALSO
81.Xr pty 4 ,
82.Xr sio 4 ,
83.Xr snp 4
84.Sh BUGS
85No terminal emulation is performed.
86All user output is reproduced as-is.
87.Sh AUTHORS
88.An Ugen J.S. Antsilevich Aq ugen@NetVision.net.il
89.Sh HISTORY
90.Nm Watch
91first appeared in
92.Fx 2.1 .
93