*BSD News Article 37713


Return to BSD News archive

Xref: sserve comp.unix.questions:57506 comp.unix.aix:47277 comp.unix.bsd:15268 comp.unix.misc:14665 comp.unix.programmer:21474 comp.unix.shell:18979 comp.unix.solaris:26399 comp.unix.user-friendly:2940
Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!bunyip.cc.uq.oz.au!munnari.oz.au!news.Hawaii.Edu!ames!purdue!haven.umd.edu!news.umbc.edu!europa.eng.gtefsd.com!newsxfer.itd.umich.edu!gumby!yale!yale.edu!news.ycc.yale.edu!remote1-line2.cis.yale.edu!news
From: news@remote1-line2.cis.yale.edu (Marc's News Account)
Newsgroups: comp.unix.questions,comp.unix.aix,comp.unix.bsd,comp.unix.misc,comp.unix.programmer,comp.unix.programmers,comp.unix.shell,comp.unix.solaris,comp.unix.user-friendly
Subject: Re: No subject
Date: 1 Nov 1994 03:12:27 GMT
Organization: Yale University
Lines: 33
Distribution: world
Message-ID: <394bmr$svb@news.ycc.yale.edu>
References: <091312Z28101994@anon.penet.fi> <1994Oct31.150849.15232@sq.sq.com>
NNTP-Posting-Host: remote1-line2.cis.yale.edu

In article <1994Oct31.150849.15232@sq.sq.com>, farook@sq.sq.com (Farook Wadia) writes:
|> In article <091312Z28101994@anon.penet.fi> an141226@anon.penet.fi writes:
|> >
|> >I've been trying to do this:
|> >
|> >find . -name ytalk -print
|> >
|> >from the root directory to see if anyone has a certain file in a "public"
|> >directory on the system (in this example: ytalk).  But my output goes
|> >haywire:
|> >
|> >find: cannot read dir ./lost+found: Permission denied
|> >find: cannot read dir ./c2/lost+found: Permission denied
|> >find: cannot read dir ./export/lost+found: Permission denied
|> >  etc, etc... FOREVER!
|> 
|> How about using a combination of -user and -prune ? I guess the above 
|> directories aren't owned by you nor you have access permission for those
|> directories. So you check if the file (directory) under consideration
|> is not owned by you (you'll have to negate -user option) then use -prune
|> (that is bypass that directory).

Option #2, of course, takes advantage of the fact that the permission denied
errors are on stderr. I don't know the C-Shell syntax for stderr redirection, but
this one is fairly guaranteed to work:

mysh%  sh -c "find . -name ytalk -print 2>/dev/null"

On a big system, of course, starting anywhere close to / will take the command
a long, long time. 

Marc.