X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:references :mime-version:content-type:in-reply-to; q=dns; s=default; b=l1i1 p0ZyY4hikqsbcyrYJCuziGY7OhF0H2Wzsi772Rw/Kc4Yr/4LH/OZDxh9BmqN3qmj ORLq5y3ekqKSYT5LkTSXzyZibujhzcOOoHBUOU53NsiztTrGbBXdU1EMCnA4TPZB FVh/h3ZxhDzuAjO4RNX09bJDRGhJ6tlHy6xPrtM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:references :mime-version:content-type:in-reply-to; s=default; bh=WI5VPXKVxG j1NvGF68pW1zJggE0=; b=NsDAmXfNUpGPcimDdxU6To5Iy2OruW9BRqX578YB4J WEwY9oJeCot31sI65uX49fsE/rLEr74HPWLtu3EERbxs0bNxKVtf7qY6DhgK9MTC hmGCAwamyWhUTWIYO/B06a7tSdNYLwhYQYDlNR0UTtI2i1SkpLkR+6RzPgzHzWdC w= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=Youll, You'll, forever X-HELO: mail.spocom.com Date: Thu, 27 Apr 2017 07:56:57 -0700 From: Gary Johnson To: cygwin AT cygwin DOT com Subject: Re: find / without traversing /proc Message-ID: <20170427145657.GA9395@phoenix> Mail-Followup-To: cygwin AT cygwin DOT com References: <380-22017442784921354 AT M2W161 DOT mail2web DOT com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <380-22017442784921354@M2W161.mail2web.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes On 2017-04-27, bonhard wrote: > The command "find /" takes forever, if it completes at all, because of the > need to traverse the induced directory /proc. Is this directory often > needed by users? Can it be skipped by setting up "export CYGWIN=something", > or even by default, with the requirement on the user to induce it if needed? > There seems to be no switch to the command find that would easily allow > "but not this subdirectory": if there was, I wouldn't be asking. Quite a > lot of surfing led me to > $ find / \( -wholename /proc -o -wholename /dev \) -prune -o -print > which is really heavyweight syntax for a simple requirement. I am pretty > certain it leads to the behaviour required "do not traverse" though various > posters seem to think it just leads to "traverse but do not report" saving > almost nothing. > Assuming the syntax is correct, I have not been able to incorporate any > qualifiers such as -type d or -type f or -type l. Any ideas where to slot > these so that they work? This isn't exactly what you're looking for because it expands to give find a list of places to look rather than just excluding some set of directories from one place to look, but it seems to work well. You'll need to have the extglob shopt set. $ find /!(dev|proc) ... HTH, Gary -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple