I need to find files within a date range to the minute. I suppose knowing how to do it to the second might be beneficial one day. Anyhow. I've learned how to use -newermt and even -not -newermt; however, I can't seem to get correct results when I combine them. I found linux examples of using find, but don't think the switches are working on OSX. See the following list of files:
#$ ls -l
total 32
-rw-r--r-- 1 testuser staff 1024 Oct 26 20:12 test1.swc
-rw-r--r-- 1 testuser staff 0 Oct 26 19:00 test1_old.swc
-rw-r--r-- 1 testuser staff 1024 Oct 26 20:12 test2.swc
-rw-r--r-- 1 testuser staff 0 Oct 26 19:00 test2_old.swc
-rw-r--r-- 1 testuser staff 1024 Oct 26 20:12 test3.swc
-rw-r--r-- 1 testuser staff 0 Oct 26 19:00 test3_old.swc
-rw-r--r-- 1 testuser staff 1024 Oct 26 20:12 test4.swc
-rw-r--r-- 1 testuser staff 0 Oct 26 19:00 test4_old.swc
-rw-r--r-- 1 testuser staff 0 Oct 26 20:11 test5.swc
-rw-r--r-- 1 testuser staff 0 Oct 26 20:13 test6.swc
-rw-r--r-- 1 testuser staff 0 Oct 26 19:00 timestamp.tmp
I would expect the following command to return test1.swc through test4.swc; however, notice that it returned test6.swc:
#$ find . -newermt '2010-10-26 20:11' -a -not -newermt '2010-10-26 20:13'
./test1.swc
./test2.swc
./test3.swc
./test4.swc
./test6.swc
I thought the minute for the -not condition was off so I tried the following, but it returned nothing:
#$ find . -newermt '2010-10-26 20:11' -a -not -newermt '2010-10-26 20:12'
#$
I've concluded that I'm not properly combining the -newermt and -not -newermt switches. Any advice on how to correct this?