Date: Sun, 07 May 2000 19:03:24 -0400 From: Jim Conner <jconner@enterit.com> To: Ben Smithurst <ben@scientia.demon.co.uk>, Darren Wyn Rees <merlin@netlink.co.uk> Cc: freebsd-questions@FreeBSD.ORG Subject: Re: "rm -rf *" - "argument list too long" Message-ID: <4.3.1.2.20000507185919.01f48a10@pseudonet.org> In-Reply-To: <20000507214635.A79359@strontium.scientia.demon.co.uk> References: <20000507201410.M540@netlink.co.uk> <20000507201410.M540@netlink.co.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
At 09:46 PM 5/7/00 +0100, Ben Smithurst wrote: >Darren Wyn Rees wrote: > > > I'm in a directory with a tonne of files I wish to delete. > > I type "rm -rf *", but it won't work, it gives "/bin/rm: Argument > > list too long". So how can I delete these many files ? > >find . -delete > > > I can "cd ..", and then "rm -rf <directory name>", and that works. > > > > However, what if I didn't wish to remove directories. In that > > case, what would I do to remove the files ? > >find . -type f -delete > >Replace "-delete" with "-print | xargs rm -f" for a more portable >version, with only a small amount of extra overhead. > > > PS. (I'm finding it takes some getting used to putting > > the operands to many commands immediately after the command. > > Why is this so with FreeBSD? With Linux I can type 'rm * -rf' etc.) > >uh.... If you can really do that with Linux, that's severely weird. >It's just common sense as far as I can see to have the options first, I >guess it's because that's what I'm used to. Wierd? Hmm...perhaps...but it is probably something Linux does. I have personally never tried it but I have noticed that Linux bins (some not all) have the capability to accept "post-"arguments. For instance...the ls command accepts arguments like: ls filename -al However, BSD won't accept this. Apparently it is something against the POSIX standard??? I dunno about that. But the idea that Linux's rm command accepts post-arguments doesn't surprise me. I don't really have an opinion for or against it either. Personally, it makes sense to me to put the arguments before the list however, apparently there are people out there who prefer the opposing. - Jim >-- >Ben Smithurst / ben@scientia.demon.co.uk / PGP: 0x99392F7D > > >To Unsubscribe: send mail to majordomo@FreeBSD.org >with "unsubscribe freebsd-questions" in the body of the message ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Today's errors, in contrast: Windows - "Invalid page fault in module kernel32.dll at 0032:A16F2935" UNIX - "segmentation fault - core dumped" Humanous Beingsus - "OOPS, I've fallen and I can't get up" ------------------------------- Jim Conner NOTJames jconner@enterit.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4.3.1.2.20000507185919.01f48a10>