On 11/04/2013 02:36 PM, alex lupu wrote:
I'm saddened that after all these years there's apparently no easy way to
do something like (expressed in Artificial Intelligence :):
"Find files modified (accessed, created) in a range of time (in minutes)"
"After but Before a time in minutes ago".
Most people with PhD's in "find", claim you cannot create something
_simple_
like,
find ... -mmin -<beginofrange> -mmin +<endofrange> ...
That despite of a voluminous, feature-rich and extremely detailed
documentation and/or blogs.
Despite various available ands, ors and the like, one can sprinkle around.
Despite the clear explanations that the "-" means "after ... ago" and
"+" means "before ... ago" (or is it the other way around? :).
Despite the lack of warning that the "-" and "+" constructs do not work
together. Apparently one at a time
You'd think that after the so called "old" find and the "stable" one
(since
2009) something like
find ... -mmin -240 [-a/-o/whatnot] -mmin +120 ...
would work.
Any thoughts?
Thanks,
-- Alex
PS. I _am_ aware of more complicated solutions, with/without 'find'.
I don't know if you consider this simple or not, but you can easily get
to a window 2 min wide. I say that because I don't know if the file
time stamps go to the seconds or not. I know that they appear in 'ls
-alQ' in whole minutes.
$ touch -t yyyymmddhhmm file1
$ touch -t yyyymmddhhmm file2
# file1 contains an earlier time and file2 contains a later time
$ find <path> -newer file1 \! -newer file2 -print
If the files were created this year you don't need yyyy. So if you know
a base time, you can search any time window from 1 min on either side to
a window that opens sometime in the past and ends right now.
Dan
--
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page