Using the watch command in OS X

I was watching a friend flex his Linux-fu and he broke out the “watch” command to monitor an interface awaiting DHCP address assignment.  I was immediately interested.

The watch command will run a command repeatedly at a definable interval (default is 2 seconds) and display the output to the screen cipla cialis.  This is great when you are waiting for something to happen (disk usage change, file transfer progress, DHCP address assignment, etc).

Sadly, this command isn’t natively installed on OSX, but it can be.  Easily.

Download watch using curl:

curl -O http://ktwit.net/code/watch-0.2-macosx/watch

Make the program executable with chmod:

chmod +x watch

Move watch to the /usr/local/bin so it will execute from anywhere

sudo mv watch /usr/local/bin/

Hat tip to the great article at OSX daily describing the process here:

http://osxdaily.com/2010/08/22/install-watch-command-on-os-x/

The fine folks at osxdaily.com demonstrated using watch to monitor disk space, but being a nerd of the network persuasion, I find I like to use it to monitor interface status using ifconfig:

watch

The basic usage for watch is: watch -n number_of_seconds “command”

 

Posted in Linux, Operating Systems, OSX

Leave a Reply