[Cialug] finding files with "find" command for specific date

Ken MacLeod ken at bitsko.slc.ut.us
Fri Sep 10 10:39:40 CDT 2010


On Fri, Sep 10, 2010 at 10:38 AM, Jeffrey Ollie <jeff at ocjtech.us> wrote:
> On Fri, Sep 10, 2010 at 10:32 AM, Afan Pasalic <afan at afan.net> wrote:
>> I need to list all files (log files) in one directory that are created
>> on specific date.
>> find /path/to/files/log* -mtime 10
>> will give me files created 10 days ago. actually it will give me all
>> files created (now is 10:31 am) between 2010-08-31 10:31:00 and
>> 2010-09-01 10:31:00
>>
>> I need all files for SPECIFIC day.
>
> Maybe this is what you need?
>
>       -daystart
>              Measure  times  (for  -amin,  -atime,  -cmin, -ctime, -mmin, and
>              -mtime) from the beginning of today rather than  from  24  hours
>              ago.   This  option only affects tests which appear later on the
>              command line.

And also use -mtime -11 to restrict the time span to one day (less
than 11 days, greater than 10).

  -- Ken


More information about the Cialug mailing list