From owner-freebsd-questions Thu Sep 19 16: 6:57 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AB04E37B401 for ; Thu, 19 Sep 2002 16:06:56 -0700 (PDT) Received: from mail.au.darkbluesea.com (mail.au.darkbluesea.com [203.185.208.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6726E43E65 for ; Thu, 19 Sep 2002 16:06:55 -0700 (PDT) (envelope-from d.anker@au.darkbluesea.com) Received: (qmail 40587 invoked by uid 82); 19 Sep 2002 23:05:48 -0000 Received: from unknown (HELO ?10.0.0.188?) (10.0.0.188) by bugtrack.au.darkbluesea.com with SMTP; 19 Sep 2002 23:05:48 -0000 Subject: Re: find case-insensitive challenge From: Duncan Anker To: freebsd-questions@FreeBSD.ORG In-Reply-To: <200209191353.g8JDrnlA057534@lurza.secnetix.de> References: <200209191353.g8JDrnlA057534@lurza.secnetix.de> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.8 Date: 20 Sep 2002 09:05:10 +1000 Message-Id: <1032476710.2579.8.camel@duncan> Mime-Version: 1.0 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, 2002-09-19 at 23:53, Oliver Fromme wrote: > > In general, it is a good idea to try to avoid -exec, because > it is inefficient. -exec runs the specified command for every > single file, whilch can be terribly slow if there are a lot of > files. Better use xargs instead, which will collect multiple > filenames and execute the command fewer times. > > This also enables you to use grep to filter the file names in > a more sophisticated way than find itself can do: > > find foo -type f | grep -i '\.jpg$' | xargs -J % mv % bar > My preferred method also. But ... I can never get that to work if there are spaces (or other illegal characters) in the file names. And no, I don't usually put spaces in my filenames, but I use this quite frequently behind the scenes on Mac OS X. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message