O'Reilly logo

Linux Pocket Guide, 2nd Edition by Daniel J. Barrett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

watch — stdin  stdout  - file  -- opt  --help  --version

Synopsis

watch [options] command

The watch program executes a given command at regular intervals; the default is every two seconds. The command is passed to the shell (so be sure to quote or escape any special characters), and the results are displayed in a full-screen mode, so you can observe the output conveniently and see what has changed. For example, watch -n 60 date executes the date command once a minute, sort of a poor man’s clock. Type ^C to exit.

Useful options

-n seconds

Set the time between executions, in seconds.

-d

Highlight differences in the output, to emphasize what has changed from one execution to the next.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required