find question

H.S. hs.samix at gmail.com
Sat Jul 14 16:41:32 UTC 2007


Pete Holsberg wrote:
> H.S. keyed the following on 7/14/2007 11:56 AM:
>> Pete Holsberg wrote:
>>   
>>> Hi,
>>>
>>> Whenever I do a find starting at /, it searches /proc! Is there a way to 
>>> make find skip /proc?
>>>
>>> Thanks.
>>>
>>>     
>> Perhaps "-prune" will help? See:
>> $> man find
>>
>> and search for prune.
> 
> Interesting! I used
> 
> find / -name proc -prune -o -name .profile 2>/dev/null
> 
> It did not run down the entire /proc hierarchy but it did report all 
> files with "proc" in their names, such as all the stuff under 
> /usr/src/linux-headers* !!
> 
> 

Try:
$> find / -path './proc' -prune -o -name .profile 2>/dev/null

This if from the command I tried to search for *gz files in the current
directory's tree but excluding directory named dat:
$> find ./ -path  './dat'  -prune -o  -name "*gz"  -print

->HS





More information about the ubuntu-users mailing list