find usage

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Tue Feb 14 17:43:41 UTC 2006


On Tue, Feb 14, 2006 at 10:59:27AM -0500, Kihara Muriithi wrote:
> Hi all,
>  I hope this question isn?t hmm, too damn
> 
>  Lets say you want to search for a file on a certain installed instance. The
> file name is foo.txt. You have know idea which directory it might lives in.
> How would you go about it to make sure your search don?t miss it?
>  I have always tried below and always got funny response
> #find  / -name foo.txt

Always use -xdev option when running on / since you don't want to look
in /dev or /proc or any other mounted virtual filesystem.  Doing so can
be bad after all.  If you have /usr or /home or such mounted seperately,
list them explicitly as places to search.  For example:

find / /home /usr /data -xdev -name foo.txt

Or just install locate or slocate from the findutils and have it index
everything every night and just use: locate foo.txt

Much faster and more efficient.

Len Sorensen
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list