如何查找特定文件在给定时间范围内被修改的次数 [英] How to find the number of times particular file has been modified in given time range

查看:41
本文介绍了如何查找特定文件在给定时间范围内被修改的次数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何查找特定文件在给定时间范围内(即最近两天在Unix客户端中)被修改的次数?

How to find the number of times particular file has been modified in given time range i.e in last 2 days in Unix client?

推荐答案

Linux内核使用 inode 对于文件系统中的文件,这些inode不会记录文件系统中的更改,但是您可以通过mtime示例请求最后一次更改 find testfile -mtime 2 这将告诉您文件是否最后一次更改48小时.

The linux kernel uses inode for files in filesystems these inodes do not log changes in the filesystem, you can however ask for the last change through mtime example find testfile -mtime 2 this will tell you if the file has changed in the last 48 hours.

您正在查看文件的日志更改,可以为此使用inotify.或 inotifywait 工具.让您有效地等待文件中的更改.

You are looking the log changes to the file, you could use inotify for that. Or the inotifywait tool. Which let's you efficiently wait for changes in a file.

我建议inotifywait.

I suggest inotifywait.

这篇关于如何查找特定文件在给定时间范围内被修改的次数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆