Re: File listing mit flags Anzeige

From: Oliver Lehmann <lehmann(at)ans-netz.de>
Date: Sun, 30 Nov 2003 15:06:28 +0100

Manfred Lotz wrote:

>
> Jetzt könnte ich es natürlich so machen:
> find / -xdev -exec ls -ldo {} \;
>
> Jedoch ist dies naturgemäss äuserst langsam.

olivleh1(at)kartoffel lib> /usr/bin/time find . -ls > /dev/null
        0.40 real 0.18 user 0.04 sys
olivleh1(at)kartoffel lib> /usr/bin/time find . -ls > /dev/null
        0.30 real 0.19 user 0.04 sys

olivleh1(at)kartoffel lib> /usr/bin/time find . | xargs ls -ldo > /dev/null
        0.62 real 0.00 user 0.04 sys
olivleh1(at)kartoffel lib> /usr/bin/time find . | xargs ls -ldo > /dev/null
        0.32 real 0.01 user 0.03 sys

olivleh1(at)kartoffel lib> /usr/bin/time find . | xargs printf "%s " | xargs
ls -ldo > /dev/null
        0.39 real 0.02 user 0.02 sys
olivleh1(at)kartoffel lib> /usr/bin/time find . | xargs printf "%s " | xargs
ls -ldo > /dev/null
        0.23 real 0.00 user 0.04 sys

olivleh1(at)kartoffel lib> /usr/bin/time find . -exec ls -ldo {} \;
>/dev/null
       28.36 real 1.23 user 17.22 sys
olivleh1(at)kartoffel lib>

Bei der 3. Version musst du nur aufpassen wenn es zu viele Dateien sind
mit der Laenge der Zeile... Achja, man sollte bei den xarg's und dem find
besser noch mit -0 und -print0 arbeiten (wegen Leerzeichen in Dateinamen
usw). Spaetestens bei Sonderzeichen steigt die 3. Version aber aus... also
bleibt eigentlich nur die 2. uebrige ;)

-- 
 Oliver Lehmann
        @home: lehmann(at)ans-netz.de
      @office: oliver.lehmann(at)mgi.de
         @www: http://www.pofo.de/  |  http://wishlist.ans-netz.de/
To Unsubscribe: send mail to majordomo.FreeBSD.org
with "unsubscribe de-bsd-questions" in the body of the message
Received on Sun 30 Nov 2003 - 15:08:58 CET

search this site