xref: /freebsd/usr.sbin/watch/watch.8 (revision 7f9d26bd9d1b2754da8429257edbde0a8237f84f)
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 watch
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, watch will exit.  The reconnect flags are unaffected by
54this option.
55.It Fl W
56Allow write access to observed tty.
57.It Ar tty
58Tty may be specified as an tty-style device, such as a pseudo tty device,
59a virtual console, or a serial line, etc.
60Names may be preceded by "/dev/".
61.Sh OPERATION
62While running in interactive mode, all user input is discarded except for:
63.Pp
64.Bl -tag -width "XXXX" -compact
65.It Sy "<control-G>"
66Exit
67.Nm Ns .
68.It Sy "<control-W>"
69Clear screen.
70.It Sy "<control-X>"
71Change attached tty.
72.Sh RESTRICTIONS
73Only the superuser can run
74.Nm Ns .
75.Sh SEE ALSO
76.Xr pty 4 ,
77.Xr sio 4 ,
78.Xr snp 4
79.Sh BUGS
80No terminal emulation is performed.
81All user output is reproduced as-is.
82.Sh AUTHORS
83.An Ugen J.S. Antsilevich Aq ugen@NetVision.net.il
84.Sh HISTORY
85.Nm Watch
86first appeared in
87.Fx 2.1 .
88