*BSD News Article 37496


Return to BSD News archive

Xref: sserve comp.unix.questions:57296 comp.unix.aix:46978 comp.unix.bsd:15245 comp.unix.misc:14588 comp.unix.programmer:21296 comp.unix.shell:18838 comp.unix.solaris:26044 comp.unix.user-friendly:2932
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
Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!bunyip.cc.uq.oz.au!munnari.oz.au!spool.mu.edu!howland.reston.ans.net!pipex!uknet!uel!msohnius
From: msohnius@novell.co.uk (Martin Sohnius)
Subject: Re: No subject
Sender: news@novell.co.uk
Message-ID: <CyqxMA.46s@novell.co.uk>
Date: Fri, 4 Nov 1994 14:01:20 GMT
References: <091312Z28101994@anon.penet.fi> <1994Oct31.150849.15232@sq.sq.com>
Organization: Novell Europe
X-Newsreader: TIN [version 1.2 PL2]
Followup-To: 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
Lines: 47

Farook Wadia (farook@sq.sq.com) wrote:
: 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).

: I guess this should work. Let us know if it does (or if it doesn't :-) ).

He (she?) clearly states two things:  (a) he is trying to do this with . at / and
(b) he is not root - or he wouldn't see the errors in the first place.

Hence he'd see:

	$ cd /
	$ find . ! -user anon -prune -o -name ytalk -print
	$

(unless he owns "/" -- one shudders at the thought.:-)

The correct answer for Bourne-like shells was posted here, as was the
work-around for the C-shell using sh -c.

--
                        +----------------------------------+
Martin Sohnius          | "If you can't be funny,          |
Novell Labs Europe      |  at least be interesting."       |
Bracknell, England      |     - Harold W. Ross             |
+44-1344-724031         +----------------------------------+
                        (I speak for myself, not for Novell or anyone else.)