6

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 software? I'm looking for something built in inside the linux-based operating systems. The date of the last change is pretty obvious but I need information at least on how many times it was accessed since the creation of the file.

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

4

1 回答 1

3

不,它没有被存储。那将是一个非常奇怪的功能。

您可以监控对文件的访问并计算您自己需要的内容。

  • 您可以编写自己的程序来执行此操作inotify。这是一个相当不错的介绍
  • 另一种选择是使用 Linux 审计子系统。这样,您将设置规则告诉内核您对哪些文件感兴趣,然后您将能够检查日志以获取所需的任何统计信息。这是一个简短的教程
于 2013-06-09T14:09:22.743 回答