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 1OGFKz-0006sy-RP for garchives@archives.gentoo.org; Sun, 23 May 2010 17:51:45 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AC798E064A; Sun, 23 May 2010 17:51:23 +0000 (UTC) Received: from etch.riddlemaster.org (unknown [209.170.146.89]) by pigeon.gentoo.org (Postfix) with ESMTP id 7FF78E064A for ; Sun, 23 May 2010 17:51:23 +0000 (UTC) Received: from merlin ([192.168.2.12] helo=merlin.localnet) by etch.riddlemaster.org with esmtp (Exim 4.71) (envelope-from ) id 1OGFKc-0000Gv-Ja for gentoo-user@lists.gentoo.org; Sun, 23 May 2010 13:51:22 -0400 From: Daniel D Jones To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] xargs and rm funkiness Date: Sun, 23 May 2010 13:51:10 -0400 User-Agent: KMail/1.12.4 (Linux/2.6.31-gentoo-r6; KDE/4.3.5; i686; ; ) References: <20100522123510.3f17eef6@karnak.local> <20100522132555.028cba37@zaphod.digimed.co.uk> In-Reply-To: <20100522132555.028cba37@zaphod.digimed.co.uk> 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="iso-8859-6" Content-Transfer-Encoding: 7bit Message-Id: <201005231351.10622.ddjones@riddlemaster.org> X-Spam-Score: -1.0 (-) X-Spam_score_int: -9 X-Spam_bar: - X-Spam_report: Spam detection software, running on the system "etch.riddlemaster.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Saturday 22 May 2010 08:25:55 Neil Bothwick wrote: > On Sat, 22 May 2010 12:35:10 +0100, David W Noon wrote: > > >find -name *.ext -exe rm "{}" + > > > > Or simpler still: > > > > find -name *.ext -delete > > Neat - I hadn't noticed that option. > > Anyone for find / -delete ? [...] Content analysis details: (-1.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP X-Archives-Salt: 969526c8-de22-4abd-a7d6-1706934200eb X-Archives-Hash: d5e276ac42c534abfa64711f78ee9f38 On Saturday 22 May 2010 08:25:55 Neil Bothwick wrote: > On Sat, 22 May 2010 12:35:10 +0100, David W Noon wrote: > > >find -name *.ext -exe rm "{}" + > > > > Or simpler still: > > > > find -name *.ext -delete > > Neat - I hadn't noticed that option. > > Anyone for find / -delete ? If you use the -delete switch, just be careful. From the man page: Warnings: Don't forget that the find command line is evaluated as an expression, so putting -delete first will make find try to delete everything below the starting points you specified. That means that the command find -name *.tmp -delete will delete all your temp files while find -delete -name *.tmp will delete everything below your current directory. If you're in the root directory, it's equivalent to running your suggested command above. I just found this out the hard way, although luckily I wasn't in the root directory when I ran the command and so didn't trash my system. I did lose the changes I'd made to the project I was working on but fortunately had a backup of the original files. -- "If you give me six lines written by the most honest man, I will find something in them to hang him." - Cardinal Richelieu