Watch outputs as they change October 10, 2005
Posted by Carthik in commands, snippets, ubuntu.trackback
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
$watch “your-command”
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!
Cool, thanks! I’ll definitely need this from time to time
That is a useful tip. Thanks.
Even though I am used to working in Fedora, I do like reading about Ubuntu. One of these days, I will make the switch.
Ravi, cool blog you got there! I will be watching it 🙂 A few more of these and Linux would certainly be easier to learn and use!
Ubuntonista, see this: http://linuxhelp.blogspot.com/
Jani, yes, I noticed Ravi’s blog, and that is the blog I mentioned in the previous comment 🙂
Cool, thanks! I’ll definitely need this from time to time