在Linux上,文件由哪个程序创建?
I have the same questions as this post
Only that my question is on the Linux platform
I have a directory in my folder
and I don't know which program has created it
Is it possible to know ?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
同样的答案适用,除非文件本身具有像某些 .doc 文件这样的元数据,并且包含您无法知道是什么创建了该文件的信息(除非您创建一个内核模块来拦截创建新文件的块请求并检查哪个应用程序提交了请求但这可能不是您想要做的)。
Same answer applies, unless the file itself has metadata like some .doc files and such that contains the information you cannot know what created the file (unless you create a kernel module to intercept block requests to create new files and check what application submitted the request but that is probably not what you want to do).
答案与上一个问题相同——一般来说,不会。
但是,您可以查看该目录的所有者和组;如果创建它的程序是守护进程(服务)进程,它可能在自己的用户/组下运行,因此创建的文件/目录可能具有这些所有权。
这说明了什么?
The answer is the same as in the previous question -- generally, no.
However, you can look at the owner and group of this directory; if the program that creates it is a daemon (service) process, it might be running under its own user / group and thus the files / directories created might have those ownerships.
What does this say?
答案与您链接的问题的答案相同。 Linux 不存储有关文件创建者的信息(具体是哪个程序创建的)。但是,就像其他答案所说,您可以创建一个监视器并自己记录该信息。
The answer is the same as the one for question you linked. Linux doesn't store information about the creator of the file as far as which program did it. But, like the other answer said, you could create a monitor and record that information yourself.