Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Nov 1997 11:11:37 -0700 (MST)
From:      Brandon Gillespie <brandon@roguetrader.com>
To:        Niall Smart <njs3@doc.ic.ac.uk>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: Suggested addition to /etc/security
Message-ID:  <Pine.BSF.3.96.971101110720.11936B-100000@roguetrader.com>
In-Reply-To: <E0xRhuZ-0004BT-00@oak67.doc.ic.ac.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 1 Nov 1997, Niall Smart wrote:
> 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.

No, it does not look the same.  'ls' will columnize the output to fit
every file its listing--but it will vary the column widths for each
execution.  Thus, calling 'ls' on all files at once looks better than
calling it seperately for each file involved.  Yeah, its completely
cosmetic, but its also easier to read.  xargs is also undesired because it
would still do the same as -exec, that being calling ls seperately for
each file... Compare:

crw-rw----  1 uucp  68   28, 195 Jul 23 20:24 /dev/cuala3
crw-------  1 uucp  68   52,   0 Jul 23 20:24 /dev/tun0
-r-sr-sr-x  1 uucp  68    110592 May 20 04:31 /usr/bin/cu*
-r-sr-sr-x  1 uucp  68     86016 May 20 04:31 /usr/bin/uustat*
-r-sr-sr-x  1 uucp  68    196608 May 20 04:31 /usr/libexec/uucp/uucico*
drwxrwxr-x  2 bin   6        512 Oct 31 10:27 /var/mail/
drwxrwxr-x  2 uucp  68       512 May 20 04:28 /var/spool/lock/

vs:

crw-rw----  1 uucp  68   28, 195 Jul 23 20:24 /dev/cuala3
crw-------  1 uucp  68   52,   0 Jul 23 20:24 /dev/tun0
-r-sr-sr-x  1 uucp  68  110592 May 20 04:31 /usr/bin/cu*
-r-sr-sr-x  1 uucp  68  86016 May 20 04:31 /usr/bin/uustat*
-r-sr-sr-x  1 uucp  68  196608 May 20 04:31 /usr/libexec/uucp/uucico*
drwxrwxr-x  2 bin  6  512 Oct 31 10:27 /var/mail/
drwxrwxr-x  2 uucp  68  512 May 20 04:28 /var/spool/lock/

The first is listing all files at once, where the latter is listing them
seperately.  The data is the same, but what is easier to read?

-Brandon Gillespie




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.971101110720.11936B-100000>