I have a pretty big directory structure with thousands of files. I want to find out if they have changed since a certain time. Now i can use
find <dir> -mmin 30 -type f
.. to find files that have changed in the last 30 minutes. However, this takes a few seconds, and I'm really not interested in (1) finding all the files that have changed, or even (2) finding which files have been changed. I am only looking for a yes / no answer to “any files that have been changed?”.
I can do (1) better using -print -quit to stop after the first file has been found. However, for the case when the files have not changed, the general search still takes a little time.
I was wondering if there is a faster way to test this? Maybe timestamps in a directory? I use ext4 if that matters.
source
share