Hello,
I am attempting to find files older than 1 day in a directory. The directory contains the following:
/u01/app/oracle/test> ls -l
total 12
drwxrwxr-x 2 oracle oinstall 4096 Mar 24 10:39 archive
-rw-r--r-- 1 oracle oinstall 429 Mar 23 10:19 rotate_backups.log
drwxr-xr-x 2 oracle oinstall 4096 Feb 24 2014 scripts
-rw-r--r-- 1 oracle oinstall 0 Mar 22 10:37 test1.log
-rw-r--r-- 1 oracle oinstall 0 Mar 22 10:37 touch2.log
-rw-r--r-- 1 oracle oinstall 0 Mar 22 10:37 touch3.log
When I run the following 'find . -maxdepth 1 -type f -mtime +1' it returns only 3 files. The command should return anything older than a day?
/u01/app/oracle/test> find . -maxdepth 1 -type f -mtime +1
./touch2.log
./test1.log
./touch3.log
Now if I run 'find . -maxdepth 1 -type f -mtime -2' it returns the file that is less than 2 days old.
/u01/app/oracle/test> find . -maxdepth 1 -type f -mtime -2
./rotate_backups.log
How do I return any files older than 1 day? I would think '-mtime +1' was the answer. Is there a date/time value I should set on the host to get the proper results. All the files in the directory are older than a day.
Thanks,
Frank