Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I installed Cygwin on my Windows XP to use some of its commands. Now I what to check a file every 2 minutes and want to use watch for this purpose but I see that Cygwin has no such command. Is this really true? what can I do instead?

share|improve this question
1  
You can find out which Cygwin packages provide which files and programs at cygwin.com/packages –  Mikel May 18 '12 at 15:26
add comment

4 Answers 4

There is watch in cygwin. But it isn't installed by default. You need to install procps package to appear watch. (you can run cygwin installer again and it allows to install only the missed packages without reinstalling the whole cygwin)

Instead of watch you can use simple cycle like:

while true ; do check file ; sleep 2 ; done
share|improve this answer
add comment

watch is in procps, so install 'procps' package.

share|improve this answer
    
That's exactly the package you need. Thx. –  zero0 Jul 13 at 15:05
add comment

Installed the ncurses package and then I get a clear screen on every run. Thank you rush.

I ran mine as

while true ; do clear; <command> <file> ; sleep 2 ; done

such as

while true ; do clear; grep ERROR server.log | tail -n 5 ; done
share|improve this answer
add comment

I wrote a command that emulates watch. I released it with source and compiled .exe file. You can find it here: http://www.garrettgalloway.com/index.php?p=projects&e=7

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.