From owner-freebsd-questions@FreeBSD.ORG Tue Jul 19 14:43:39 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 730EC16A421 for ; Tue, 19 Jul 2005 14:43:39 +0000 (GMT) (envelope-from i.tanusheff@procreditbank.bg) Received: from mail.procreditbank.bg (mail.procreditbank.bg [212.95.179.198]) by mx1.FreeBSD.org (Postfix) with SMTP id 8B49443D48 for ; Tue, 19 Jul 2005 14:43:38 +0000 (GMT) (envelope-from i.tanusheff@procreditbank.bg) Received: (qmail 44001 invoked from network); 19 Jul 2005 17:43:37 +0300 Received: from unknown (HELO localhost) (127.0.0.1) by localhost with SMTP; 19 Jul 2005 17:43:37 +0300 Received: from proxy.procreditbank.bg ([127.0.0.1]) by localhost (mail.procreditbank.bg [127.0.0.1]) (amavisd-new, port 10024) with SMTP id 27700-36 for ; Tue, 19 Jul 2005 17:43:34 +0300 (EEST) Received: (qmail 43979 invoked from network); 19 Jul 2005 14:43:34 -0000 Received: from unknown (HELO outmail.procreditbank.bg) (172.16.248.123) by mail.procreditbank.bg with SMTP; 19 Jul 2005 14:43:34 -0000 In-Reply-To: <20050719143416.GB18276@beatrix.daedalusnetworks.priv> To: Giorgos Keramidas MIME-Version: 1.0 X-Mailer: Lotus Notes Release 6.5.1 January 21, 2004 From: Ivailo Tanusheff Message-ID: Date: Tue, 19 Jul 2005 17:43:45 +0300 X-MIMETrack: Serialize by Router on DOMINO_HQ/PROCREDITBANK(Release 6.5.1|January 21, 2004) at 07/19/2005 05:43:33 PM, Serialize complete at 07/19/2005 05:43:33 PM X-Virus-Scanned: by amavisd-new using ClamAV at procreditbank.bg X-Mailman-Approved-At: Wed, 20 Jul 2005 13:02:17 +0000 Content-Type: text/plain; charset="US-ASCII" X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Jonathan Glaschke , freebsd-questions@freebsd.org, owner-freebsd-questions@freebsd.org 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: Tue, 19 Jul 2005 14:43:39 -0000 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