delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/04/27/13:16:47

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:subject:references:to:from:reply-to:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=FHHgVoMmVZOgLM4X
AOYsrDUGz82Ipp0kAXHPJhIqPERTHrCaIKR5vOpFMK7f/X21lX6OHAc3Uf4XqpoH
hE0ssfBDQKnsyEkncZ7ZFE+St1CXz+q22SR1VCAlG5oDgEPwSULjG4laGoJTKifZ
FZ7ma5axqqUNx8tMSNcNIttxsSo=
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:subject:references:to:from:reply-to:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=WW9/+WvjL9hBfPV6Jh9tDV
qSJW0=; b=IXtxSxHnVYSl9aOAILzGxeNkZExIYCJxO2TyUru+LF2HKpEmtrlRc4
5VDXmQ27+t8nB2BxqmlGD0tmCmIUmvB84ziMY5aNVDYJ7cFSKwJFoj4x4ujsBVRi
m3IuytjxpV+muc9Yy8TOLq0cWBRALTyM02JqvGQiXJ1dd7xWG0d4E=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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.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
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 AT M2W161 DOT mail2web DOT com> <20170427145657 DOT GA9395 AT phoenix>
To: cygwin AT cygwin DOT com
From: Brian Inglis <Brian DOT Inglis AT SystematicSw DOT ab DOT ca>
Reply-To: Brian DOT Inglis AT SystematicSw DOT ab DOT ca
Message-ID: <ec9fa913-a335-9713-51dc-1ef86c7853ab@SystematicSw.ab.ca>
Date: Thu, 27 Apr 2017 11:16:30 -0600
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>
X-CMAE-Envelope: MS4wfKBcm6c0ZSczytKtBMfivZEs/QW1qSNKjNmZtH+dGjq5vSWmWpg9CnA+U9vzJF39gNecQ8mxJX494UXuPpLvVyqW4MNUgRmw1lGg8S1+PS2FOrwf9IKm +HfNTrnZFokRXBIW3wGonAZQ9Ujvz6zkADeylQZxXm8CfFx7SZmdmBwmaOskq+yPAQShGdTqXiqPiQ==
X-IsSubscribed: yes

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019