Faster Searching !
Thomas Cameron
thomas.cameron at camerontech.com
Mon Feb 7 03:44:21 UTC 2005
----- Original Message -----
From: "fly over" <fly_over at soon.com>
To: "Paul Howarth" <paul at city-fan.org>; <fedora-list at redhat.com>
Sent: Sunday, February 06, 2005 9:23 PM
Subject: Faster Searching !
> Hi Guruz ,
>
> I want to ask about the fastest searching command as i am using to search
> SUID/GUID files in / directory . script given as:
>
> ls -l /usr/bin | awk '/^-.....[s]/ { print $3, $9 }'
>
> or using 'find' utility as below
>
>
> find /usr/bin -perm +6000
>
>
>
> now the question is Which works faster, script without 'find' or with it?
> and How do you know?
>
> thankx.
Run each command under /usr/bin/time:
/usr/bin/time ls -l /usr/bin | awk '/^-.....[s]/ { print $3, $9 }'
/usr/bin/time find /usr/bin -perm +6000
My bets are on the find command - the ls command relies on a pipe to a
completely different command, which is going to slow the whole process down
a bunch.
Thomas
More information about the fedora-list
mailing list