From owner-freebsd-questions@FreeBSD.ORG Fri Oct 14 19:17:02 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 AB35116A41F for ; Fri, 14 Oct 2005 19:17:02 +0000 (GMT) (envelope-from msommer@argotsoft.com) Received: from mx1a.swcp.com (mx1a.swcp.com [216.184.2.64]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2B07843D5E for ; Fri, 14 Oct 2005 19:16:54 +0000 (GMT) (envelope-from msommer@argotsoft.com) Received: from taka.swcp.com (taka-216.swcp.com [216.184.2.3]) by mx1a.swcp.com (8.13.3/8.13.3/Debian-6) with ESMTP id j9EJGr9B013814; Fri, 14 Oct 2005 13:16:53 -0600 Received: from argotsoft.com (argotsoft.com [198.59.115.127]) by taka.swcp.com (8.13.3/8.13.1) with ESMTP id j9EJGoUA054339; Fri, 14 Oct 2005 13:16:51 -0600 (MDT) (envelope-from msommer@argotsoft.com) Received: from ATHABASCA (athabasca.argotsoft.com [192.168.3.104]) by argotsoft.com (8.12.3/8.12.3) with ESMTP id j9EJGNuo015437; Fri, 14 Oct 2005 13:16:27 -0600 (MDT) Message-Id: <200510141916.j9EJGNuo015437@argotsoft.com> From: "Mark J. Sommer" To: "'Drew Tomlinson'" , "'FreeBSD Questions'" Date: Fri, 14 Oct 2005 13:16:22 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.5510 In-Reply-To: <434FFEB4.90308@mykitchentable.net> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 thread-index: AcXQ8YsjxGm8ZQEvTN29QSKHv5kqSwAAgd7g X-Scanned-By: MIMEDefang 2.9 (www dot roaringpenguin dot com slash mimedefang) X-Virus-Scanned: ClamAV 0.87/1134/Fri Oct 14 02:07:44 2005 on av1 X-Virus-Status: Clean X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on kaimen.swcp.com X-Spam-Status: No, hits=-2.4 required=10.0 tests=ALL_TRUSTED autolearn=failed version=3.0.4 X-Spam-Level: Cc: Subject: RE: Help With Find Syntax 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: Fri, 14 Oct 2005 19:17:02 -0000 > -----Original Message----- > From: owner-freebsd-questions@freebsd.org [mailto:owner-freebsd-questions@freebsd.org] On Behalf Of Drew Tomlinson > Sent: 10/14/2005 12:54 PM > To: FreeBSD Questions > Subject: Help With Find Syntax > > I want to recursively search a directory and return files that end in ".jpg" or ".gif" but I can't seem to get the find syntax right. My basic command lines are: > > find /multimedia/Pictures -iname "*.gif" -print > > OR > > find /multimedia/Pictures -iname "*.jpg" -print > > Both of these work perfectly. But I can't figure out how to combine the two. 'man find' tells me the the OR operator is '-or'. Thus it seems that some incantation along this line would work: > > $ find /multimedia/Pictures -iname "*.gif" -or "*.jpg" -print > find: paths must precede expression > Usage: find [path...] [expression] > > I've tried various placement of quotes, parenthesis, etc. but can't seem to find the right way to do this. Can someone show me my error? > > Thanks, > > Drew > Try: find /multimedia/Pictures \( -iname '*.gif' -o -iname '*.jpg' \)