Date: Mon, 8 May 2000 01:59:58 +0200 From: "Olivier Cortes" <olive@deep-ocean.net> To: "Doug Barton" <DougB@gorean.org>, "FreeBSD Questions" <freebsd-questions@FreeBSD.org> Subject: RE: "rm -rf *" - "argument list too long" Message-ID: <EJEFLAEIHOBBKCGOKMJJCEBJCCAA.olive@deep-ocean.net> In-Reply-To: <39160161.4BCFEFE3@gorean.org>
next in thread | previous in thread | raw e-mail | index | archive | help
yeah ! great answer ! I use to be too sophisticated. thanks to pull me back to simplicity :) Olivier PS: but don't you think a little program written in perl ou c could.... Okay, i shut up :) > -----Message d'origine----- > De : owner-freebsd-questions@FreeBSD.ORG > [mailto:owner-freebsd-questions@FreeBSD.ORG]De la part de Doug Barton > Envoyé : lundi 8 mai 2000 01:51 > À : Darren Wyn Rees > Cc : freebsd-questions@freebsd.org > Objet : Re: "rm -rf *" - "argument list too long" > > > 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 ? > > > > 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 ? > > First, ignore the overly complicated and potentially dangerous answers > so far on this thread. :) Second, think about it for a minute. If "*" > provides a list that's too long for rm to handle, why not break it up > into smaller chunks? For example, if your files mainly have alpha > characters in their names, do something like: > > rm [a-c]* > > Starting with larger chunks, and going smaller as needed till the error > messages disappear. > > Doug > -- > "Live free or die" > - State motto of my ancestral homeland, New Hampshire > > Do YOU Yahoo!? > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > 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?EJEFLAEIHOBBKCGOKMJJCEBJCCAA.olive>