Watch outputs as they change October 10, 2005Posted by Carthik in commands, snippets, ubuntu.
This is another “trick” that might seem trivial to the gurus out there, but is something I discovered recently.
Use the command watch to regularly update and refresh the output of some command. If you want to see the “running output” then watch is the program for you.
Using it is simple, by default it updates the output once every two seconds. So
will update the output of “your-command” every two seconds.
To make it refresh more frequently, try
$watch -n1 “your-command”
and to make it highlight differences as and when they occur, try the -d option.
As an example, the command
$watch -d -n1 “netstat -t tcp”
will show you a list of the IP connections heading out from your computer, and update the output every second. It will also highlight new items/changes as they happen.
Another little gem from teh ubuntu-users mailing list archives!