From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68829 invoked by alias); 27 Apr 2017 17:16:33 -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 68817 invoked by uid 89); 27 Apr 2017 17:16:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=Hx-languages-length:1679, forever X-HELO: smtp-out-no.shaw.ca Received: from smtp-out-no.shaw.ca (HELO smtp-out-no.shaw.ca) (64.59.134.9) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Apr 2017 17:16:31 +0000 Received: from [192.168.1.100] ([174.0.238.184]) by shaw.ca with SMTP id 3n1qdMvviM9gt3n1rdmEwU; Thu, 27 Apr 2017 11:16:32 -0600 X-Authority-Analysis: v=2.2 cv=a+JAzQaF c=1 sm=1 tr=0 a=WqCeCkldcEjBO3QZneQsCg==:117 a=WqCeCkldcEjBO3QZneQsCg==:17 a=IkcTkHD0fZMA:10 a=ONHSo9Zu35_ylZNwv_MA:9 a=QEXdDO2ut3YA:10 Subject: Re: find / without traversing /proc References: <380-22017442784921354@M2W161.mail2web.com> <20170427145657.GA9395@phoenix> To: cygwin@cygwin.com From: Brian Inglis Reply-To: Brian.Inglis@SystematicSw.ab.ca Message-ID: Date: Fri, 28 Apr 2017 14:07:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170427145657.GA9395@phoenix> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfKBcm6c0ZSczytKtBMfivZEs/QW1qSNKjNmZtH+dGjq5vSWmWpg9CnA+U9vzJF39gNecQ8mxJX494UXuPpLvVyqW4MNUgRmw1lGg8S1+PS2FOrwf9IKm +HfNTrnZFokRXBIW3wGonAZQ9Ujvz6zkADeylQZxXm8CfFx7SZmdmBwmaOskq+yPAQShGdTqXiqPiQ== X-IsSubscribed: yes X-SW-Source: 2017-04/txt/msg00355.txt.bz2 On 2017-04-27 08:56, Gary Johnson wrote: > 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) ... I've used find /??? /sbin to exclude /cygdrive, /home, /proc. If I just want to find something I know is somewhere under ... I use ls .../**/*something* or .../**/*somedir*/, enabled with shopt globstar, and is quicker than find. -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada -- 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