[PLUG] Recursively list directories

Don Buchholz don at truedisk.com
Fri Jul 5 16:58:07 UTC 2002


Paul Heinlein wrote:
> 
> On Wed, 3 Jul 2002, E. Rogan Creswick wrote:
> 
> > using xargs is a faster way of doing it, you'd notice the difference
> > for more than 200 or so dirs.
> >
> > find / -type d | xargs ls -ld
> 
> Absolutely: find's -exec switch is very expensive. If you want to be
> even safer, then null-terminate your find-ings to handle directories
> with spaces or other odd characters in the name:
> 
>   find / -type d -print0 | xargs --null ls -ld
> 

Which makes me-thinks the easiest way is

    find / -type d -ls

... and avoid "exec" and "xargs" altogether.  (OK, so you 
get a couple extra columns of information at the front of
each line ...)

- Don




More information about the PLUG mailing list