“Watch Command” is to set a watcher on a linux command for real time monitoring of the command output.
Syntax as below
watch [OPTIONS] COMMAND
The -n
(--interval
), the option set the time interval between updates
watch -n INTERVAL_IN_SECONDS COMMAND
The -d
(--difference
), the option shows the changes between updates.
watch -d COMMAND
example. below command will show the log update every 2 seconds.
watch -n 2 "tail /tmp/some.log"
Good Read:
https://www.tutorialspoint.com/ubuntu/ubuntu_tutorial.pdf
https://ubuntu.com/tutorials/command-line-for-beginners#1-overview