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