Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

watch(8) [freebsd man page]

WATCH(8)						    BSD System Manager's Manual 						  WATCH(8)

watch -- snoop on another tty line SYNOPSIS
watch [-cinotW] [-f snpdev] [tty] DESCRIPTION
The watch utility allows the user to examine all data coming through a specified tty using the snp(4) device. If the snp(4) device is not available, watch will attempt to load the module (snp). The watch utility writes to standard output. The options are as follows: -c Reconnect on close. If the tty observed by watch is closed, automatically reattach to the same tty. If this option is not speci- fied, watch will request a new tty if running in interactive mode or exit if running without a controlling tty. -f snpdev If this option is specified, watch will use snpdev as the snp(4) device. Without this option, watch will attempt to find the next available snp(4) device. -i Force interactive mode. Interactive mode is a default if watch is started from a tty. If output is redirected to a file, interac- tive mode can still be requested by specifying this option. -n Disable the ability to switch the watched tty interactively. This disables both change requests made with <control-X> as well as automatic prompting when the current tty is closed or overflows. In all cases where a prompt would be displayed, watch will exit. The reconnect flags are unaffected by this option. When this flag is used, <control-X> is passed through to the terminal. -o Reconnect on overflow. The behavior of watch if the observed tty overflows is similar to the behavior if the observed tty is closed. For more info see snp(4). -t Print the date and time when observation of a given tty is started. -W Allow write access to observed tty. tty Tty may be specified as a tty-style device, such as a pseudo tty device, a virtual console, or a serial line, etc. Names may be pre- ceded by /dev/. OPERATION
While running in interactive mode, all user input is discarded except for: <control-G> Exit watch. <control-W> Clear screen. <control-X> Change attached tty, unless this feature is disabled, in which case control-X is passed to the terminal as with other control charac- ters. SEE ALSO
pty(4), sio(4), snp(4), kldload(8) HISTORY
The watch utility first appeared in FreeBSD 2.1. AUTHORS
Ugen J.S. Antsilevich <> BUGS
No terminal emulation is performed. All user output is reproduced as-is. BSD
November 24, 2001 BSD

Check Out this Related Man Page

WATCH(1)							Linux User's Manual							  WATCH(1)

watch - execute a program periodically, showing output fullscreen SYNOPSIS
watch [-dhv] [-n <seconds>] [--differences[=cumulative]] [--help] [--interval=<seconds>] [--version] <command> DESCRIPTION
watch runs command repeatedly, displaying its output (the first screenfull). This allows you to watch the program output change over time. By default, the program is run every 2 seconds; use -n or --interval to specify a different interval. The -d or --differences flag will highlight the differences between successive updates. The --cumulative option makes highlighting "sticky", presenting a running display of all positions that have ever changed. watch will run until interrupted. NOTE
Note that command is given to "sh -c" which means that you may need to use extra quoting to get the desired effect. Note that POSIX option processing is used (i.e., option processing stops at the first non-option argument). This means that flags after command don't get interpreted by watch itself. EXAMPLES
To watch for mail, you might do watch -n 60 from To watch the contents of a directory change, you could use watch -d ls -l If you're only interested in files owned by user joe, you might use watch -d 'ls -l | fgrep joe' To see the effects of quoting, try these out watch echo $$ watch echo '$$' watch echo "'"'$$'"'" You can watch for your administrator to install the latest kernel with watch uname -r (Just kidding.) BUGS
Upon terminal resize, the screen will not be correctly repainted until the next scheduled update. All --differences highlighting is lost on that update as well. Non-printing characters are stripped from program output. Use "cat -v" as part of the command pipeline if you want to see them. AUTHORS
The original watch was written by Tony Rems <> in 1991, with mods and corrections by Francois Pinard. It was reworked and new features added by Mike Coleman <> in 1999. 1999 Apr 3 WATCH(1)
Man Page