From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 110171 invoked by alias); 27 Apr 2017 14:57:00 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 110159 invoked by uid 89); 27 Apr 2017 14:56:59 -0000 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 Received: from mail.spocom.com (HELO mail.spocom.com) (206.63.224.240) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Apr 2017 14:56:58 +0000 Received: from localhost (97-115-134-196.spkn.qwest.net [97.115.134.196]) by mail.spocom.com with SMTP; Thu, 27 Apr 2017 07:56:43 -0700 Date: Fri, 28 Apr 2017 10:05:00 -0000 From: Gary Johnson To: cygwin@cygwin.com Subject: Re: find / without traversing /proc Message-ID: <20170427145657.GA9395@phoenix> Mail-Followup-To: cygwin@cygwin.com References: <380-22017442784921354@M2W161.mail2web.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 X-SW-Source: 2017-04/txt/msg00353.txt.bz2 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