>From info find:

2.3.2 Comparing Timestamps
--------------------------

As an alternative to comparing timestamps to the current time, you can
compare them to another file's timestamp.  That file's timestamp could
be updated by another program when some event occurs.  Or you could set
it to a particular fixed date using the `touch' command.  For example,
to list files in `/usr' modified after February 1 of the current year:

     touch -t 02010000 /tmp/stamp$$
     find /usr -newer /tmp/stamp$$
     rm -f /tmp/stamp$$

 -- Test: -anewer file
 -- Test: -cnewer file
 -- Test: -newer file
     True if the file was last accessed (or its status changed, or it
     was modified) more recently than FILE was modified.  [...]
     As an example, to list any files modified since
     `/bin/sh' was last modified:

          find . -newer /bin/sh

I guess this is what you're looking for?

        Rony 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Ehud Karni
Sent: Thursday, March 15, 2007 3:02 PM
To: [EMAIL PROTECTED]
Cc: [email protected]
Subject: Re: find -mtime and wrong data return

On Thu, 15 Mar 2007 14:38:30 ik <[EMAIL PROTECTED]> wrote:
>
> I wish to use the find command in order to find all the files that
> were created prior to specific file.
>
> So I tried to use the following command:
>
> find -type f -mtime -7
>
> In order to get all the files that where modified prior to  a week
> ago, but it only gives me files that where last changed a week ago,
> and not prior to that at all.
>
> I can't find any other way to get such data without using some "bash
magic".
>
> Am I missing something here, or can't I get files prior to what I
> specy on -mtime ?

You used the wrong format. Instead of -7 you should use +7.

>From find man page:

  +n     for greater than n,
  -n     for less than n,
   n      for exactly n.

You need the "greater than n" (greater = older).

Ehud.


=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to