how to touch a file with prev time stamp

i want to find the files which are modified in last 30 to 120 minutes

i am using "find . -mmin +30 -mmin -120 "

it is giving me the error

find: bad option -mmin
find: path-list predicate-list

can somebody help me out .

Thank you

The -mmin option is a GNU find extension. Install GNU find if it's available for your system, or use e.g. the find2perl tool as a workaround.

dont we have any other command to find the files which are modified in last 1 to 2 hours.??

A search for "find mmin" brings up some promising threads from these forums. This is a frequently recurring topic so I believe you should find some useful pointers there. In particular, advanced/complex uses of the find command and find command using -mmin param should be helpful.

Use -mtime option with find.
example
find /path/ -name {filenames} -mtime {}

  • nilesh

I have replied to this question (with perl script) previously, here is the link to my reply:

http://www.unix.com/shell-programming-scripting/73429-check-lists-file-created-between-30-60-min.html\#post302215096

You can change the values of these variables, for ur question:
my $thirty_mins_in_secs = 3060; # to 3600
my $sixty_mins_in_secs = 60
60; # to 2*3600

Regards,
Visit my blog: techdiary-viki.blogspot.com