监控Linux上的文件和目录访问
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4205815/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
monitoring file and directory access on linux
提问by gruszczy
Do you know of any linux program, that would monitor accesses to directories and files in the filesystem? I would like to able to produce some report of how many times certain files were accessed in some period?
你知道有什么 linux 程序可以监视对文件系统中目录和文件的访问吗?我希望能够生成一些报告,说明在某个时期某些文件被访问了多少次?
采纳答案by Lee Netherton
You probably want inotify-tools. Inotify is part of the linux kernal that triggers events on watched files, directories, or even the contents of entire directories. These tools are command line utilities that tap into the capabilities of inotify and allow you to use them, for example, in your shell scripts.
您可能需要inotify-tools。Inotify 是 linux 内核的一部分,它在被监视的文件、目录甚至整个目录的内容上触发事件。这些工具是命令行实用程序,可以利用 inotify 的功能并允许您使用它们,例如,在您的 shell 脚本中。
Specifically, you will probably want to look at inotifywatch
具体来说,你可能想看看 inotifywatch