From owner-freebsd-questions@FreeBSD.ORG Mon Apr 6 23:10:06 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC46B1065735 for ; Mon, 6 Apr 2009 23:10:06 +0000 (UTC) (envelope-from jalmberg@identry.com) Received: from mx1.identry.com (on.identry.com [66.111.0.194]) by mx1.freebsd.org (Postfix) with ESMTP id 813038FC1A for ; Mon, 6 Apr 2009 23:10:06 +0000 (UTC) (envelope-from jalmberg@identry.com) Received: (qmail 72048 invoked by uid 89); 6 Apr 2009 23:10:43 -0000 Received: from unknown (HELO ?192.168.1.110?) (jalmberg@75.127.142.66) by mx1.identry.com with ESMTPA; 6 Apr 2009 23:10:43 -0000 Mime-Version: 1.0 (Apple Message framework v753.1) In-Reply-To: <20090406211111.GF70541@dan.emsphone.com> References: <5BF30BAA-2B35-46C8-8257-56B077D00A8C@identry.com> <20090406211111.GF70541@dan.emsphone.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <4D0D0EC0-6547-4D04-9006-D5CE128C4DB1@identry.com> Content-Transfer-Encoding: 7bit From: John Almberg Date: Mon, 6 Apr 2009 19:10:04 -0400 To: freebsd-questions@freebsd.org X-Mailer: Apple Mail (2.753.1) Subject: Re: How to remove all files with a certain extension X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2009 23:10:07 -0000 On Apr 6, 2009, at 5:11 PM, Dan Nelson wrote: > In the last episode (Apr 06), John Almberg said: >> This is a real newbie question, but I can't figure it out... >> >> I want to remove all .tar files from a directory tree. I think >> something >> like the following should work, but I must have something wrong, >> because >> it doesn't: >> >> find . -name *.tar -exec rm /dev/null {} \; > > find . -name "*.tar" -delete > > Make sure you quote your wildcards so the shell doesn't expand > them, and use > the -delete primary to save a fork/exec for each filename. Fantastic. I never noticed the -delete option before. Amazing what you can find in a man page if you know it's there :-) Thanks: John