Do You Know a Similar Program for Watch (Unix Watch Command) on Windows?

I find unxutils and and gnuwin32 Packages don't have this command...

2 Answers

On systems where I don't have a watch, I often use an infinite loop (you could also write it as an alias)

I'm using Bash syntax here, but you can surely do something similar on your platform:

while true; do my-thing-to-watch; sleep 1; done

And, for convenience, one can wrap it into a command which reuses either $0 or $@ depending on your platform.

1

Lee's answer works for Bash, but for Windows, create a file watch.bat and put it in any PATH folder:

for /l %%g in () do @( %* & timeout /t 5)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Robert Thorne

Robert Thorne

Automotive & Future Transportation Editor

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.

Share this article
Twitter Facebook Pinterest