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?
yuzhConnect With a Mentor Commented:
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 
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";
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.