From owner-freebsd-questions@FreeBSD.ORG Mon Oct 15 00:33:06 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 27595F50 for ; Mon, 15 Oct 2012 00:33:06 +0000 (UTC) (envelope-from pschmehl_lists@tx.rr.com) Received: from cdptpa-omtalb.mail.rr.com (cdptpa-omtalb.mail.rr.com [75.180.132.120]) by mx1.freebsd.org (Postfix) with ESMTP id DF94B8FC0A for ; Mon, 15 Oct 2012 00:33:05 +0000 (UTC) X-Authority-Analysis: v=2.0 cv=Dp3UCRD+ c=1 sm=0 a=+L5dYfeubEW4PLvjDgtIXQ==:17 a=WAZfUmVf-EkA:10 a=nGzRxwCMVZQA:10 a=05ChyHeVI94A:10 a=kj9zAlcOel0A:10 a=ayC55rCoAAAA:8 a=BTvy5PFH36UA:10 a=UdvEN9gbqWsBAELrqE0A:9 a=CjuIK1q_8ugA:10 a=+L5dYfeubEW4PLvjDgtIXQ==:117 X-Cloudmark-Score: 0 X-Originating-IP: 76.184.157.127 Received: from [76.184.157.127] ([76.184.157.127:56580] helo=[10.0.0.8]) by cdptpa-oedge04.mail.rr.com (envelope-from ) (ecelerity 2.2.3.46 r()) with ESMTP id 74/F5-11677-BB95B705; Mon, 15 Oct 2012 00:32:59 +0000 Date: Sun, 14 Oct 2012 19:32:58 -0500 From: Paul Schmehl To: FreeBSD Questions Subject: Question about find - excluding directories Message-ID: <7651E6A84D436D388849B985@Pauls-MacBook-Pro.local> X-Mailer: Mulberry/4.0.8 (Mac OS X) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Paul Schmehl List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 00:33:06 -0000 I want to use find to locate files that don't belong to a certain user but should belong to that user. But there are subdirectories I want to exclude. I have tried using this, but it doesn't work: find /path/to/dir -type d ! -uid num \( -type d ! -name dirname -prune \) If I leave off the part in parentheses, it finds all the files I'm looking for but also files in the subdirs I'm not interested in. If I add the parentheses, it doesn't find any files at all. This is FreeBSD 8.3 RELEASE. So how can I find these files without descending into directories I'm not interested in? Paul Schmehl, Senior Infosec Analyst As if it wasn't already obvious, my opinions are my own and not those of my employer. ******************************************* "It is as useless to argue with those who have renounced the use of reason as to administer medication to the dead." Thomas Jefferson "There are some ideas so wrong that only a very intelligent person could believe in them." George Orwell