Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Nov 1997 14:42:42 +0000
From:      njs3@doc.ic.ac.uk (Niall Smart)
To:        Brian Somers <brian@awfulhak.org>, njs3@doc.ic.ac.uk (Niall Smart)
Cc:        Brandon Gillespie <brandon@roguetrader.com>, freebsd-hackers@freebsd.org
Subject:   Re: Suggested addition to /etc/security
Message-ID:  <E0xS1Eg-0000MG-00@oak66.doc.ic.ac.uk>
In-Reply-To: Brian Somers <brian@awfulhak.org> "Re: Suggested addition to /etc/security" (Nov  2,  1:02am)

next in thread | previous in thread | raw e-mail | index | archive | help
On Nov 2,  1:02am, Brian Somers wrote:
} Subject: Re: Suggested addition to /etc/security
> > On Nov 1, 10:58am, Brandon Gillespie wrote:
> > > > > find / -nouser -nogroup
> > > > Shouldn't this be "find / -nouser -o -nogroup -print"?
> > > Yeah, or even better:
> > > 
> > > files=`find / -nouser -o -nogroup -print`
> > > ls -ldF $files
> > > 
> > > (this looks better than find / -nouser -o -nogroup -exec ls -ldF {} \;)
> > 
> > Looks better?  They should produce identical output. "find / -nouser -o
> > -nogroup -print | xargs -n 30" is more efficient btw :)) however
> > using -exec with find is othe only one that works with filenames with
> > embedded spaces.
> 
> Check the -print0 option on find.  That, and the -0 option to xargs 
> makes it a far better choice than -exec.

Ah, I was aware of this but thought it was a GNUism.

> BTW, why the -n 30 to xargs ?

Well I thought that size of the arguments to ls might exceed ARG_MAX
but a quick read of the xargs man page shows that it deals with this
possibility (the default -s option is ARG_MAX - 2048) so I guess it's
not necessary after all, even if it was necessary that probably wasn't
the best way to deal with it so forget I ever mentioned it ;)

Niall



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E0xS1Eg-0000MG-00>