find files more than 30 minutes old


How can I use the find command to find files that are more than 30 minutes old?.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

the find mtime, ctime and atime options only take integers so you can only get a day granularity.  Try a script using perl stat function something like

($filename) = @ARGV;
die "I need a file name.\n" unless $filename;
   ($atime,$mtime,$ctime) = stat($filename);
   print "atime = $atime\n";
   print "mtime = $mtime\n";
   print "ctime = $ctime\n";
Download the GUN find (findutils), for you version of OS from:

then you can use:

/usr/local/bin/find /mydir -type f -cmin +30 -print

With the native Solaris "find", the best you can do is "touch & find"

you need to do something like:

create stamp file , then
touch -t [YY]MMDDhhmm stampfile

write the current date ,
and time older than the current time by 30 min.

touch -t 200307120000 stampfile

find /yourdir -type f ! -newer stampfile -print

also see http:Q_20670315.html 

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.