find files by time

I'm working on a SunOS 5.8 box and I have to search recursively in directories matching a certain pattern for files with a .log extension that have changed within the last n-minutes, and than select the least recently used file and open it for reading, preferrably with tail. Does anyone know how I can construct such a command in one line? I have both Ksh and bash on this box.

Hi there,
I wrote this script that will do the job (with a few changes - like including the file pattern in the find command).

Also, if you want, you can look here for other (possibly better and more efficient) ways of doing this.

Assuming perl, ability to create executable scripts, and -mmin most solutions provided in these forums will work.

I've read the trick on using a reference file with touch and -newer. I was looking for a way to do this in one line, without having to create a file.

By using -t option of touch it is possible to precisely specify the datetime stamp:

touch -t 0802130800 /tmp/date
find AA -newer /tmp/date -name ".log" -exec ls -l {} \;

will print all files newer than Feb 13 2008, 08:00

use

find . -atime <seconds> -mtime <seconds> -ctime <seconds>

atime=access time
mtime=modify time
ctime=change time