File access count in Linux

前端 未结 1 1145
灰色年华
灰色年华 2021-01-18 08:05

Is there a way how to effectively determine the number of accesses to a specific file and the process which accessed it without storing the access info by a 3rd party softwa

相关标签:
1条回答
  • 2021-01-18 08:44

    No, it is not stored. That would be a very odd feature.

    You can monitor access to a file and count what you need yourself.

    • You can write your own program doing this with inotify. Here is a rather nice introduction.
    • Another option is using Linux audit subsystem. This way you'll set up rules telling the kernel which files are you interrested in, and later you'll be able to check logs to get whichever statistics you need. Here is a short tutorial.
    0 讨论(0)
提交回复
热议问题