找出最近2分钟内文件是否已被修改 [英] Find out if file has been modified within the last 2 minutes

查看:69
本文介绍了找出最近2分钟内文件是否已被修改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在bash脚本中,我要检查文件在最近2分钟内是否已更改.

In a bash script I want to check if a file has been changed within the last 2 minutes.

我已经发现我可以使用stat file.ext -c %y访问上次修改的日期.如何检查此日期是否早于两分钟?

I already found out that I can access the date of the last modification with stat file.ext -c %y. How can I check if this date is older than two minutes?

推荐答案

我认为这会有所帮助,

find . -mmin -2 -type f -print

find / -fstype local -mmin -2

这篇关于找出最近2分钟内文件是否已被修改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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