How to Use watch Command
If you need to execute a certain command repeatedly, you may use the watch command to do the repeating for you.
In this example, the command ps will be run every 2 seconds to monitor how fast the new processes spawn:
$ watch -n2 "ps aux|grep http"
The watch command will run ps every two seconds and it will display the output in stdout. You may increase or decrease the interval as necessary. This is useful if you want to monitor a process at certain time intervals. Personally, I use this to check for processes that spawns children way too fast.
Barack Obama Inauguration: Watch Live Streaming Video
For those who want to watch the live streaming broadcast of Barack Obama’s Inauguration, I have added an embedded video for my readers. Take part in this historical event and watch how United States of America takes a different direction as the 44th and First African-American President begins changing the country, hopefully for the good.
Tip: How to Use watch Command
I have never known that there is a command in Linux called watch. Basically, watch runs a program in a period of time, and displaying the output in real time.
watch command syntax is very simple. One typical use of the command watch is running it with traceroute. This is one example:
watch 'traceroute google.com'
This will run the traceroute command, display the output and when it is done, it repeats the process again.
Here a couple more examples of the watch command:
watch -n 10 free -m
This command will run the command free in ten-second intervals, and display the output.
watch -n 3 'cat /proc/interrupts'
This command will display the interrupts in 3-second intervals.
Search PinoyTux
Subscribe to Email Feeds
Blog Lounge
Popular Posts
Recent Posts
Drop your Card Here
Recent Comments
- Anidich1 on Tip: Add User and Generate Password Script
- Tom S on Cebu Pacific Sucks
- kadersardar on PinoyTux Spreads Some CommentLuv
- Steve on Creative Labs Threatens Third Party Driver Modder
- Barry on Free Laptops with Broadband Connection








