The watch command (Linux)
posted by Allan@TechCrammer @ 10:07pm, Sunday 28 December 2008.
For many of you *nix (Linux and Unix) gurus may have already been using the "watch" program. Though I when I first saw someone else using it and asked if I could get the code for what I thought was a shell script he created. He said "Dude! You never used watch, look at the man pages!". Of course I ran a "man watch" immediately to see the different arguments and options.
Basically, it just runs a program and sleeps and runs the program again displaying to the screen. For instance "watch -n 5 ls" will run the "ls" command showing your directory listing every five seconds.
Anyway, something basic to use though handy at times.
How about we hear some of those other handy programs/scripts you use out there?
Regards,
Allan








Comments
The two commands that I often use that took a little digging to find were "which" and "apropos" (actually, I remembered "which" from my Amiga days ). "Which" shows you the path for a particular command and "apropos" gives you the appropriate commands that are available in a particular environment. The command "apropos mbr," for example, revealed an MBR-copy program on the Knoppix DVD that saved me a LOT of grief.
Michael Rudas - 4:11pm, Monday 5 January 2009.
Thanks for the post. I have heard of in the past, but never used "apropos". That is definetly a handy command to know, though not one you see alot. I have used "which" and "locate" though sometimes have to do a recursive "find" if the file is not in a normal path. This usually takes alot longer and is system process intensive. Thanks again for sharing!
Also good to know you use Knoppix. Debian (Knoppix) is a great OS that in my opinion doesn't get its fair share of attention as do other "free" operating systems. I am running Debian 2.6.18-6-486 on an old Pentium II which I wrote the article about Python Serial reading.
Allan@TechCrammer - 11:24am, Wednesday 7 January 2009.
Submit Your Comment
You are not logged in.