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

Christopher R. Rhodes arreyder at apache.org
Fri Sep 10 11:47:27 CDT 2010


On 09/10/10 11:04, Matthew Nuzum wrote:
> On Fri, Sep 10, 2010 at 10:32 AM, Afan Pasalic <afan at afan.net> wrote:
>>  hi,
>> I need to list all files (log files) in one directory that are created
>> on specific date.
>> find /path/to/files/log* -mtime 10
> 
> You said "created" but you're using -mtime. mtime is "last modified"
> time. Is that OK?
> 


Some perl for fun and looking at ctime as Nuzum suggests:


ls | perl -e '@d=localtime;while(<>){(stat)[11];$date=sprintf "%4d%02d%02d",$d[5]+1900,$d[4]+1,$d[3];if($date eq
20100910){print $date,"\n";}}'


Change the $date to what ever year/month/day you are after.


crr/arreyder
arreyder at apache.org


More information about the Cialug mailing list