2

Is there any way to monitor the real time content of a folder in commandline? What i need is like dir command but updates the content continuously.

Ad Infinitum
  • 131
  • 4

2 Answers2

2

You may find the following command helpful:

watch -n1 ls /path/to/directory

It will list the content of the '/path/to/directory' directory and update the report every one second. You can modify the -n option according to your needs.

RoseHosting
  • 2,371
  • 2
  • 13
  • 5
  • It is exactly what I am looking but when i enter the command, it says the command "watch" is not found or written false. – Ad Infinitum Mar 16 '17 at 15:38
  • I'm sorry, but I just noticed that you have Windows OS. I'm not sure, but I don't think that the 'watch' command is available for Windows. You will have to find an alternative. – RoseHosting Mar 16 '17 at 15:52
  • Thank you very much. With the help of your answer, I could find a similar soluation on Windows :) – Ad Infinitum Mar 16 '17 at 15:53
1

I have found the answer from a different question on this site (with the help of @RoseHosting). The answer belongs to the @harrymc.

I have written something like that;

@ECHO OFF
:loop
  %*
 dir "path/to/myFolder"
  timeout /t 5
goto loop
Ad Infinitum
  • 131
  • 4