- [Instructor] Hello and welcome
to the next video of section eight;
Monitoring Command Outputs with Watch.
In the previous video, we've learned about listing
the top 10 CPU consuming processes in an hour.
In this video, we'll see how
to monitor command outputs with Watch.
We might need to continue to watch the output
of a command for a period of time in equal intervals.
For example, while copying a large file
we might need to watch the growth of the file size.
In order to do that,
we can use the watch command to execute the DU command
and output repeatedly.
This section explains how to do that.
The watch command can be used to monitor the output
of a command on the terminal at regular intervals.
The syntax of the watch command is as follows:
This command will update the output at a default interval
of two seconds.
We can also specify the time interval at which the output
needs to be updated by using the -n seconds.
For example, let's explore an additional feature
of the watch command.
Highlighting the differences in the watch output.
In Watch there's an option for updating the differences
that occur during the execution of a command
and update interval to be highlighted using colors.
Different highlighting can be enabled
by using the -d option as follows.
Awesome, we've successfully learned
how to monitor command outputs with Watch.
In the next video we'll learn about logging access
to files and directories.