On Mon, 12 Feb 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.

locate <FILE>

You can alias locate to actually use grep which allows using regexps for finding things in locate output directly. E.g. in my case this is set to:

#!/bin/sh
/usr/bin/locate.orig /|grep -E "$*"

This can be made nicer but it's good enough.

Peter

=================================================================
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]

Reply via email to