0

Hello

I am trying to use the find command to search for the last files modifyed under certain directory

Example: #find /tmp -mtime -1

find all the files modifyed from 1 hour ago

The question is: Somebody knows hou can I do the same but using minutes or seconds instead of hours.
I am new to scripting so I would apreciate any help

3
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by rast1979
0

Hi Rast,

To do this with find, try the -cmin switch:

-cmin n
              File’s status was last changed n minutes ago.

EDIT: Or you might be looking for this one:

-mmin n
              File’s data was last modified n minutes ago.

(I got this from the man page for find btw. This might be a new feature... haven't researched it that far yet.)

Hope this helps!
-G

0

Thanks for your help

The problem I have is that mmin is not supported in HP-UX that is the OS I have to program in.

The solution I found is to use the -newer option of the find command.

Regards

Ricardo

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.