watch

>Usage

Install watch command by entering brew install watch in terminal.

The watch command is used to run a program periodically, displaying its output in the terminal at regular intervals.

This is especially useful for monitoring the output of commands that report system status or resource usage over time. By default, watch updates every 2 seconds, but this interval can be adjusted. System administrators often use watch to keep track of changing data without manually re-executing commands.

>Synopsis

watch [option] command

>Options

-n[seconds]

Sets the interval between updates (in seconds).

Example:

Dots

watch -n 5 date

watch -n 5 date


Every 5.0s: date Tue Nov 19 15:42:33 2024
Tue Nov 19 15:42:33 UTC 2024

-d

Highlights differences between updates.

-t

Turns off the header (time and interval display).

>Quiz

Progress: Question ? out of ?

Question Title

Page written by Alessia Sanchez