From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1OFtb6-0005N6-Nv for garchives@archives.gentoo.org; Sat, 22 May 2010 18:38:56 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3E94CE0C16; Sat, 22 May 2010 18:38:54 +0000 (UTC) Received: from borg.medozas.de (borg.medozas.de [188.40.89.202]) by pigeon.gentoo.org (Postfix) with ESMTP id 11439E0C16 for ; Sat, 22 May 2010 18:38:54 +0000 (UTC) Received: by borg.medozas.de (Postfix, from userid 25121) id 4BA23F0C32B98; Sat, 22 May 2010 20:38:53 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by borg.medozas.de (Postfix) with ESMTP id 307AFF124 for ; Sat, 22 May 2010 20:38:53 +0200 (CEST) Date: Sat, 22 May 2010 20:38:53 +0200 (CEST) From: Jan Engelhardt To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] xargs and rm funkiness In-Reply-To: <20100522084621.27a5ad56@zaphod.digimed.co.uk> Message-ID: References: <201005212149.49715.ddjones@riddlemaster.org> <20100522084621.27a5ad56@zaphod.digimed.co.uk> User-Agent: Alpine 2.01 (LSU 1266 2009-07-14) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archives-Salt: cf0f1d1f-ac16-4e90-b4cd-70dd30e8c1e4 X-Archives-Hash: 2da50b188fd26812561f590f3f3a83f9 On Saturday 2010-05-22 09:46, Neil Bothwick wrote: >On Fri, 21 May 2010 21:49:49 -0400, Daniel D Jones wrote: > >> find -name *.ext | xargs -0 rm >> >> I get the result: >> >> rm: cannot remove `Long File Name One.ext\nLong File Name Two.ext\nLong >> File Name Three.ext\n': File name too long. > >xargs can suck with anything but plain ASCII-without-spaces filenames., That's why you use NUL terminators. Simple as that. Also find's -exe calls rm *for each* file when used with \;. >find -name *.ext -exe rm "{}" \; > >or maybe even > >find -name *.ext -exe rm "{}" +