From owner-freebsd-questions Fri Apr 28 9:48:20 2000 Delivered-To: freebsd-questions@freebsd.org Received: from scientia.demon.co.uk (scientia.demon.co.uk [212.228.14.13]) by hub.freebsd.org (Postfix) with ESMTP id 0034A37B8E6 for ; Fri, 28 Apr 2000 09:48:14 -0700 (PDT) (envelope-from ben@scientia.demon.co.uk) Received: from strontium.scientia.demon.co.uk ([192.168.91.36] ident=exim) by scientia.demon.co.uk with esmtp (Exim 3.12 #1) id 12lC8z-0005al-00; Fri, 28 Apr 2000 15:53:25 +0100 Received: (from ben) by strontium.scientia.demon.co.uk (Exim 3.12 #7) id 12lC8z-000MrV-00; Fri, 28 Apr 2000 15:53:25 +0100 Date: Fri, 28 Apr 2000 15:53:25 +0100 From: Ben Smithurst To: Shawn Barnhart Cc: questions@FreeBSD.ORG Subject: Re: 'find' command -- maxdepth option? Message-ID: <20000428155325.A86507@strontium.scientia.demon.co.uk> References: <04f101bfb116$e4baafa0$b8209fc0@marlowe> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <04f101bfb116$e4baafa0$b8209fc0@marlowe> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Shawn Barnhart wrote: > Maybe I'm just braindead, but is there a way to make Freebsd's find command > not recurse a directory hierarchy? Gnu find has a -maxdepth directive that > lets you specify how deep to go. Look at -prune. If you only want to find files in the current directory, try something like, find . \( ! -name . -type d -prune \) -or \( other_contition -print \) where "other_condition" should be replaced appropriately. If you want the directories printed as well, put "-print" after "-prune" or remove the "-print" from the end, making the default to print any file matching either condition. This probably doesn't work the same as -maxdepth but it might work for what you want. -- Ben Smithurst / ben@scientia.demon.co.uk / PGP: 0x99392F7D To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message