Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Jul 2005 14:30:13 -0700
From:      Garrett Cooper <youshi10@u.washington.edu>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Delete files in directory...
Message-ID:  <42DEC265.50605@u.washington.edu>
In-Reply-To: <OF46AC7F18.B7E5315D-ONC2257043.0050C514-C2257043.0050EA06@procreditbank.bg>
References:  <OF46AC7F18.B7E5315D-ONC2257043.0050C514-C2257043.0050EA06@procreditbank.bg>

next in thread | previous in thread | raw e-mail | index | archive | help
Ivailo Tanusheff wrote:

>Giorgos Keramidas <keramida@ceid.upatras.gr> 
>Sent by: owner-freebsd-questions@freebsd.org
>07/19/2005 05:34 PM
>
>To
>Jonathan Glaschke <no-html@jonathan-glaschke.de>
>cc
>freebsd-questions@freebsd.org
>Subject
>Re: Delete files in directory...
>
>
>
>
>
>
>On 2005-07-19 16:27, Jonathan Glaschke <no-html@jonathan-glaschke.de> 
>wrote:
>  
>
>>On Tue, Jul 19, 2005 at 12:50:01PM +0300, Casper wrote:
>>    
>>
>>>Sorry, simple, stupid q. How to make that what come in directory
>>>/usr/files/ for example are erased? Or only put in cron after while
>>>do "rm /usr/files/*"?
>>>      
>>>
>>Yes, using cront to do that is possible and i think there is no reason 
>>    
>>
>against
>  
>
>>cron.
>>
>>you need "rm -rf /usr/files/*" if there are directories too in 
>>    
>>
>/usr/files..
>
>This doesn't remove ".*" subdirs.  A more complete alternative that
>doesn't move /usr/files under the feet of programs that may have it
>open as their current working directory is probably:
>
>                 rm -fr /usr/files/* /usr/files/.[^.]*
>
>Be very careful with the -r option of rm(1) though.  VERY careful.
>
>Just my $0.02,
>- Giorgos
>
>
>Why don't you use:
>find /usr/files/ -delete
>  
>
rm -Rf does the same thing (with removing .* files), but once again, be 
very wary of the -r and -R flags since they can cause a lot of damage if 
used improperly.
-Garrett



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?42DEC265.50605>