From owner-freebsd-questions@FreeBSD.ORG Wed Jul 20 21:30:14 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EA28816A420 for ; Wed, 20 Jul 2005 21:30:14 +0000 (GMT) (envelope-from youshi10@u.washington.edu) Received: from mxout7.cac.washington.edu (mxout7.cac.washington.edu [140.142.32.178]) by mx1.FreeBSD.org (Postfix) with ESMTP id 689B743D4C for ; Wed, 20 Jul 2005 21:30:14 +0000 (GMT) (envelope-from youshi10@u.washington.edu) Received: from smtp.washington.edu (smtp.washington.edu [140.142.32.139]) by mxout7.cac.washington.edu (8.13.4+UW05.04/8.13.4+UW05.05) with ESMTP id j6KLUDdp021423 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 20 Jul 2005 14:30:13 -0700 Received: from [128.95.196.181] (dhcp196-181.ee.washington.edu [128.95.196.181]) (authenticated authid=youshi10) by smtp.washington.edu (8.13.4+UW05.04/8.13.4+UW05.05) with ESMTP id j6KLUDc1010021 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Wed, 20 Jul 2005 14:30:13 -0700 Message-ID: <42DEC265.50605@u.washington.edu> Date: Wed, 20 Jul 2005 14:30:13 -0700 From: Garrett Cooper User-Agent: Mozilla Thunderbird 1.0.5 (Macintosh/20050711) X-Accept-Language: en-us, en MIME-Version: 1.0 CC: freebsd-questions@freebsd.org References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: Delete files in directory... X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jul 2005 21:30:15 -0000 Ivailo Tanusheff wrote: >Giorgos Keramidas >Sent by: owner-freebsd-questions@freebsd.org >07/19/2005 05:34 PM > >To >Jonathan Glaschke >cc >freebsd-questions@freebsd.org >Subject >Re: Delete files in directory... > > > > > > >On 2005-07-19 16:27, Jonathan Glaschke >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