From owner-freebsd-questions@FreeBSD.ORG Mon Feb 7 23:21:32 2011 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 CC1C3106564A for ; Mon, 7 Feb 2011 23:21:32 +0000 (UTC) (envelope-from jmc-freebsd2@milibyte.co.uk) Received: from relay.ptn-ipout02.plus.net (relay.ptn-ipout02.plus.net [212.159.7.36]) by mx1.freebsd.org (Postfix) with ESMTP id 690278FC08 for ; Mon, 7 Feb 2011 23:21:32 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuEFAN8NUE3Unw4S/2dsb2JhbACXCo4cc7k9hVoE Received: from outmx06.plus.net ([212.159.14.18]) by relay.ptn-ipout02.plus.net with ESMTP; 07 Feb 2011 23:21:22 +0000 Received: from helix.plus.com ([84.92.153.232] helo=curlew.milibyte.co.uk) by outmx06.plus.net with esmtp (Exim) id 1PmaOY-00082r-D7; Mon, 07 Feb 2011 23:21:22 +0000 Received: by curlew.milibyte.co.uk with local (Exim 4.72) (envelope-from ) id 1PmaOX-0001jY-2X; Mon, 07 Feb 2011 23:21:21 +0000 From: Mike Clarke To: freebsd-questions@freebsd.org Date: Mon, 7 Feb 2011 23:21:20 +0000 User-Agent: KMail/1.9.10 References: <201102072056.p17Ku5Da097335@x.it.okstate.edu> In-Reply-To: <201102072056.p17Ku5Da097335@x.it.okstate.edu> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201102072321.21035.jmc-freebsd2@milibyte.co.uk> X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: jmc-freebsd2@milibyte.co.uk X-SA-Exim-Scanned: No (on curlew.milibyte.co.uk); SAEximRunCond expanded to false Cc: Martin McCormick Subject: Re: Using Multiple -prune directives in a find command 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, 07 Feb 2011 23:21:32 -0000 On Monday 07 February 2011, Martin McCormick wrote: > Can one use the -prune directive multiple times in a > find command to specify a list of directories not to descend? > > It would be like > > find . -name "*" -prune dir1 -prune dir2 -print > > or whatever you wanted find to do, but that does not work or I > wouldn't be asking. Find appears to get confused and thinks dir1 > is a command. find . -type d -name dir1 -prune -o -name dir2 -prune -o -name \* ... should list all files except those in dir1 or dir2 -- Mike Clarke