xref: /freebsd/usr.sbin/watch/watch.8 (revision 4a0f765fbf09711e612e86fce8bb09ec43f482d9)
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 ciotnW
13.Ar tty
14.\"  watch [-ciotnW] [<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 n
49Disable the ability to switch the watched tty interactively.  This disables
50both change requests made with <control-X> as well as automatic prompting
51when the current tty is closed or overflows.  In all cases where a prompt
52would be displayed, watch will exit.  The reconnect flags are unaffected by
53this option.
54.It Fl W
55Allow write access to observed tty.
56.It Ar tty
57Tty may be specified as an tty-style device, such as a pseudo tty device,
58a virtual console, or a serial line, etc.
59Names may be preceded by "/dev/".
60.Sh OPERATION
61While running in interactive mode, all user input is discarded except for:
62.Pp
63.Bl -tag -width "XXXX" -compact
64.It Sy "<control-G>"
65Exit
66.Nm watch .
67.It Sy "<control-W>"
68Clear screen.
69.It Sy "<control-X>"
70Change attached tty.
71.Sh RESTRICTIONS
72Only the superuser can run
73.Nm watch .
74.Sh SEE ALSO
75.Xr pty 4 ,
76.Xr sio 4 ,
77.Xr snp 4
78.Sh BUGS
79No terminal emulation is performed.
80All user output is reproduced as-is.
81.Sh AUTHOR
82Ugen J.S. Antsilevich <ugen@NetVision.net.il>
83.Sh HISTORY
84.Nm Watch
85first appeared in
86.Fx 2.1 .
87