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 61.Pa /dev/ . 62.El 63.Sh OPERATION 64While running in interactive mode, all user input is discarded except for: 65.Pp 66.Bl -tag -width "XXXX" -compact 67.It Sy "<control-G>" 68Exit 69.Nm Ns . 70.It Sy "<control-W>" 71Clear screen. 72.It Sy "<control-X>" 73Change attached tty. 74.El 75.Sh RESTRICTIONS 76Only the superuser can run 77.Nm Ns . 78.Sh SEE ALSO 79.Xr pty 4 , 80.Xr sio 4 , 81.Xr snp 4 82.Sh BUGS 83No terminal emulation is performed. 84All user output is reproduced as-is. 85.Sh AUTHORS 86.An Ugen J.S. Antsilevich Aq ugen@NetVision.net.il 87.Sh HISTORY 88.Nm Watch 89first appeared in 90.Fx 2.1 . 91