commands.sh

watch

all

Execute a program periodically and monitor the output in full-screen mode.

More info →

Options (4)

-n, --intervalboolean

Re-run a command every 60 seconds

Example: watch {{[-n|--interval]}} 60 {{command}}
-d, --differencesboolean

Monitor disk space, highlighting differences as they appear

Example: watch {{[-d|--differences]}} df
-g, --chgexitboolean

Exit `watch` if the visible output changes

Example: watch {{[-g|--chgexit]}} {{lsblk}}
-c, --colorboolean

Interpret terminal control characters

Example: watch {{[-c|--color]}} {{ls --color=always}}

Examples (6)

Repeatedly run a command and show the result

Re-run a command every 60 seconds

watch [-n|--interval] 60 command

Monitor disk space, highlighting differences as they appear

watch [-d|--differences] df

Repeatedly run a pipeline and show the result

watch "command1 | command2 | command3"

Exit `watch` if the visible output changes

watch [-g|--chgexit] lsblk

Interpret terminal control characters

watch [-c|--color] ls --color=always
made by @shridhargupta | data from tldr-pages