cmdxray / commands / watch

What does watch do?

run a command repeatedly and watch its output update.

▸ Explain your own watch command →

watch examples, explained

$ watch -n 10 date

  • watchrun a command repeatedly and watch its output update
  • -nset the interval between runs, in seconds
  • 10value for -n
  • datean argument passed to the command

$ watch -d ls

  • watchrun a command repeatedly and watch its output update
  • -dhighlight what changed between updates
  • lsan argument passed to the command

watch flags & options

-nset the interval between runs, in seconds
-dhighlight what changed between updates
-thide the header showing the interval and command
-gexit as soon as the output first changes
-bbeep if the command exits non-zero
-efreeze and wait for a key if the command errors

Other commands

Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.