> From: JW <[EMAIL PROTECTED]>
> 
> At 08:31 PM 1/30/2002 -0600, you wrote:
> >>I'm trying to get a list of files 30 day sold or younger. I thought the following 
>would to the trick:
> >>
> >>find . -type f -mtime 30 -ls   
> >>
> >>But that only prints files that are exactly 30 days old. How do I do that "and 
>younger" part? 
> >>Less then 31 days would be a suitable substitute too.
> >>
> >>Jonathan Wilson
> >
> >Read the man page for find again.  It is described right there on the page.
> 
> Actually no, it was not in the name page - not that I could see. And I did read it. 
>The best it did was:
> 
>        -mtime n
>               File's data was last modified n*24 hours ago.
> 
> No mention of + or - there.


Just for the record . . .

Keep reading - it's there a little farther down in the man page:


   TESTS
       Numeric arguments can be specified as

       +n     for greater than n,

       -n     for less than n,

       n      for exactly n.


> 
> OTH, I did discover by reading the man page that there is an info page "info Finding 
>Files" - and that proved quite useful. As I said in my Re: I did figure out, thanks 
>to the info page, no thanks to the man page.
> 
> The following did the trick:
> 
> find /logs/ -type f -mtime +30 -name "*log.gz" -exec cp -p {} . \;


Dave



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to