From owner-freebsd-questions Thu May 21 21:35:55 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA27467 for freebsd-questions-outgoing; Thu, 21 May 1998 21:35:55 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from andrsn.stanford.edu (root@andrsn.Stanford.EDU [36.33.0.163]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA27423 for ; Thu, 21 May 1998 21:35:40 -0700 (PDT) (envelope-from andrsn@andrsn.stanford.edu) Received: from localhost (andrsn@localhost.stanford.edu [127.0.0.1]) by andrsn.stanford.edu (8.8.8/8.6.12) with SMTP id VAA07511; Thu, 21 May 1998 21:33:03 -0700 (PDT) Date: Thu, 21 May 1998 21:33:03 -0700 (PDT) From: Annelise Anderson To: Malartre cc: Greg Lehey , Frank Griffith , freebsd-questions@FreeBSD.ORG Subject: Re: How do I erase an entire directory In-Reply-To: <3564E6AC.2AC3614B@aei.ca> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, 21 May 1998, Malartre wrote: > Greg Lehey wrote: > > > On Thu, 21 May 1998 at 22:05:12 -0400, Malartre wrote: > > > Frank Griffith wrote: > > > > > >> I am still getting use to installing ports and make some > > >> mistakes when I do. Each time I install and things aren't > > >> quite right, I erase everything and reinstall the port. My > > >> problem is I can't seem to figure out how to erase an > > >> entire directory. If it has files in it, I can't just type rmdir > > >> without doing each directory, starting at the bottom of the > > >> tree. Can someone tell me if there is a command similar > > >> to deltree in DOS for FreeBSD. > > >> > > >> Note: deltree will allow you to delete an entire directory and > > >> all its subfolders with one swift command line. > > > > > > Try > > > rm -R dir > > > > > > # pwd > > > /home/kaput/pub/FreeBSD/FreeBSD-current/ > > > # cd > > > # pwd > > > /home/kaput/ > > > # rm -R pub > > > > > > > rm -R is correct for FreeBSD and Solaris 2, but other versions of UNIX > > don't understand it. All versions understand rm -r, however, which > > does the same thing, so it's preferable to use that option. > > > > Greg > > -- > > Well, its an errata in the tutorial for > newbies:http://www.freebsd.org/tutorials/newuser/newuser.html#ch-7 > I have Cc to Annelise Anderson :-) > > Malartre > -- Thanks--it should be rm -r. I will change it one of these days. But rm -R should have worked; if it didn't, it may be because the rm command is aliased to rm -i, where i means "interactive" and asks you to confirm each deletion. You can check existing aliases by typing alias You can either, then, unalias rm or use rm -rf, where the f "forces" and overrides the interactive. This is often used in scripts for precisely this purpose. Annelise To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message