On Monday 12 February 2007, Maxim Veksler wrote:
> On 2/12/07, Shlomi Fish <[EMAIL PROTECTED]> wrote:
> > On Monday 12 February 2007, Maxim Veksler wrote:
> > > Hi,
> > >
> > > Someone at work told me that doing "du -a <DIR>|grep <FILE>" is faster
> > > then "find <DIR>|grep <FILE>". I've measured, it doesn't looks quite
> > > so. It did OTOH got me wondering what's the quickest way to answer if
> > > file existed in a hierarchy of directories.
> > >
> > > Assuming I'm not interested in any information besides the answer if
> > > file existing or not. I would only need to access the directory
> > > listing and not the inode of each file, right? Is there some utility
> > > that can do this very simple search efficiently?
> >
> > Why not use a find predicate for that?
>
> Well... laziness.
>
> I find "find|grep" be a much simpler to type then "find . -name XYZ
> [-noleaf] -quit"
>
So do I sometimes. However, you specifically asked about speed and
find . -name *is* faster than find | grep.
Regards,
Shlomi Fish
---------------------------------------------------------------------
Shlomi Fish [EMAIL PROTECTED]
Homepage: http://www.shlomifish.org/
Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.
=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]