mtime

hi, :slight_smile:
consider the following statement
find . -type f -mtime -1 -print

here what is the use of -1 option.

any help?

cheers
RRK

mtime adds criteria:

the file's data was modified n days ago

in ur case find displays fles modified a day ago.
Thanks!
Sharif.S

ok.
pls consider the following statement

find ./ -mtime +10 -name "Baseball*.txt*" -o -name "Basketball*.txt*" -o -name "DeleteBasketball*" -print

In this example what is the use of +10 .

I am getting a little bit confusion between - and + symbols. :confused:

any help?

cheers
RRK

-mtime -10 means modification time less than 10 days and -mtime +10 means modification time greater than 10 days.

http://www.hccfl.edu/pollock/Unix/FindCmd.htm

When specifying time with find options such as -mmin (minutes) or -mtime (24 hour periods, starting from now), you can specify a number "n" to mean exactly n, "-n" to mean less than n, and "+n" to mean more than n. 2 For example:

find . -mtime 0 # find files modified within the past 24 hours
find . -mtime -1 # find files modified within the past 24 hours
find . -mtime 1 # find files modified between 24 and 48 hours ago
find . -mtime +1 # find files modified more than 48 hours ago
find . -mmin +5 -mmin -10 # find files modifed between 5 and 10 minutes ago

Enjoy !!
Adhir Garg

Or look at Perderabo's writeup on the same at mtime, ctime, and atime

oh!
What a great explanation! :slight_smile:

In HP-UX, is there an equivalent option for -mmin in find? I got bad option for -mmin in find command. I try to find files older than 60 min. Any help is appreciated.
Thanks