0

I have a file that is being updated via a script I do not have access. I am trying to see how often it gets updated.

One thing that occurred to me was doing a:

watch -n 0.1 "ls -la"

The problem with this command is that maybe the file is updated faster than my -n parameter. The second problem is that the resolution of the output is in minutes, thus, I cannot see if the files is updated every second or less than that.

Is there a more clever/elegant way of looking into how often a file is updated in the terminal?

Yi Qiang Ji
  • 152
  • 1
  • 8
  • 1
    https://unix.stackexchange.com/questions/323901/how-to-use-inotifywait-to-watch-a-directory-for-creation-of-files-of-a-specific – Artem S. Tashkinov Feb 29 '24 at 08:57
  • 2
    Artem's link seems on point! Do note, however, that the other program might really be hammering out writes at a higher rate than you can process notifications. I don't know which rates you're expecting, but if 10 times per second is much too slow for you, a shell script might not be sufficient and you might need to look into compiled languages. – sina bala Feb 29 '24 at 10:23

0 Answers0