From owner-freebsd-questions@FreeBSD.ORG Tue Jul 19 14:34:21 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 DCC6E16A41F for ; Tue, 19 Jul 2005 14:34:21 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from aiolos.otenet.gr (aiolos.otenet.gr [195.170.0.93]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1B20B43D48 for ; Tue, 19 Jul 2005 14:34:19 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from beatrix.daedalusnetworks.priv (aris.bedc.ondsl.gr [62.103.39.226]) by aiolos.otenet.gr (8.13.4/8.13.4/Debian-1) with SMTP id j6JEYH3m001539; Tue, 19 Jul 2005 17:34:17 +0300 Received: from beatrix.daedalusnetworks.priv (localhost [127.0.0.1]) by beatrix.daedalusnetworks.priv (8.13.3+Sun/8.13.3) with ESMTP id j6JEYGqb018299; Tue, 19 Jul 2005 17:34:16 +0300 (EEST) Received: (from keramida@localhost) by beatrix.daedalusnetworks.priv (8.13.3+Sun/8.13.3/Submit) id j6JEYGJB018298; Tue, 19 Jul 2005 17:34:16 +0300 (EEST) Date: Tue, 19 Jul 2005 17:34:16 +0300 From: Giorgos Keramidas To: Jonathan Glaschke Message-ID: <20050719143416.GB18276@beatrix.daedalusnetworks.priv> References: <42DCCCC9.5080802@os.lv> <20050719162708.GA46146@jogla.fbsd> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050719162708.GA46146@jogla.fbsd> Cc: 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:34:22 -0000 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