jump to navigation

Watch outputs as they change October 10, 2005

Posted 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
$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!


1. Matthias - October 10, 2005

Cool, thanks! I’ll definitely need this from time to time

2. Ravi - October 11, 2005

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.

3. ubuntonista - October 11, 2005

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!

4. Jani Tarvainen - October 16, 2005

Ubuntonista, see this: http://linuxhelp.blogspot.com/

5. ubuntonista - October 16, 2005

Jani, yes, I noticed Ravi’s blog, and that is the blog I mentioned in the previous comment 🙂

6. seks izle - September 29, 2010

Cool, thanks! I’ll definitely need this from time to time

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: