Operating System - HP-UX
1830350 Members
1825 Online
110001 Solutions
New Discussion

find files within last hour

 
T. H. Doan
New Member

find files within last hour

hi, i'm trying to compile a list of files that have changed within the last hour. the closest i can get to this without creating temp files is this:

find somedir -mtime -1

but this is only accurate to the last day, not hour. does anyone know how to do an equivalent of a linux 'find -mmin -60' ??

thanks,
tom
4 REPLIES 4
Sridhar Bhaskarla
Honored Contributor

Re: find files within last hour

Hi Tom,

The easiest way I use is to use 'newer' option. You can 'touch' anyfile with the date-time you need and use -newer option to find the files. For ex., below will create a file /tmp/stamp with the time stamp 11-20-2004 11:02:02 and find the files in /your_path that are newer than that file.

touch 20041120110202 /tmp/stamp
find /your_path -newer /tmp/stamp

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
T. H. Doan
New Member

Re: find files within last hour

thanks sri,

i hate to create extra files to do what i want, but i think in this case it's probably the simplest thing.

cheers,
tom
Ranjith_5
Honored Contributor

Re: find files within last hour

Hi Doan,
Kindly close the thread if your purpose is met and assign points to sri.

Best regards,
Syam
T. H. Doan
New Member

Re: find files within last hour

i didn't want to have to use an auxiliary file to accomplish this task, but it appears that there is no simpler way to do this in hpux. i will use what sri suggested (find -newer), which was my backup plan if no one could answer my original question.