Number of files in Linux

Is there a way to effectively determine the number of calls to a specific file and the process that it accessed without saving access information from third-party software? I am looking for something embedded in Linux based operating systems. The date of the last change is pretty obvious, but I need information, at least about how many times it has been inverted since the file was created.

Can anyone shed light on this file by accessing information? Is it stored somewhere?

+6
source share
1 answer

No, it is not saved. This will be a very strange feature.

You can control access to the file and count what you need.

  • You can write your own program by doing this with inotify . Here is a pretty nice introduction .
  • Another option is the Linux audit subsystem. Thus, you will configure the rules that tell the kernel which files you are interested in, and later you can check the logs to get the necessary statistics. Below is a short tutorial .
+3
source

Source: https://habr.com/ru/post/946893/


All Articles