Watch
watch¶
Step-in replacement for watch(1) on systems that lack it. Repeatedly clears the screen and runs the given command, displaying a header line with the command and current timestamp (unless -t is set).
Piped or compound commands must be quoted as a single string: watch 'ps aux | head'
Example¶
watch df -h
watch -n 5 uptime
watch -t 'ps aux | head'
Options¶
- -h
Print usage and return
- -n
seconds Seconds between updates (default: 2)
- -t
Suppress the header line
- -v
Print version information and return
Arguments¶
- ... (string): Command to run
Exit codes¶
- 0: Loop terminated (e.g. by Ctrl-C); or -h/-v flag
- 1: Invalid option or no command given