How can i search a file which has been created or modified in last five minutes

Hi
Can some one please help me
How can i search a file which has been created or modified in last five minutes
I have used the command

find . -mmin -5

and it does not work
i get an error -mmin is bad option

Please help
Much regards
Tarun

#!/bin/ksh
# filetimes
filetime()
{
    perl  -e '
          $mtime = (stat $ARGV[0])[9];
          print $mtime
         ' $1
}
now=$(date +%s)
limit=$(( $now - 300 ))  # 5 minutes ago

find /path/to/files -type f |\
while read filename 
do
	dt=$(filetime  $filename)
	if [[ $dt -lt $limit ]] ; then
   		ls -l $filename # do whatever you want here
   	fi
done

Did you try this

find . -mmin -5
  • nilesh