Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I need to often search a large directory structure (with 1 G / 13K files of data). find / grep take a lot of time. Is there any utility (or can one make an index of these files) for faster searching.

share|improve this question
2  
What about locate? –  ghm1014 Feb 28 '13 at 22:03

2 Answers 2

Depending on your Unix/Linux Flavor you can easily use slocate/mlocate/all the derivates.

Usually u can just hit updatedb as root and then do

locate <searchpattern>

Hitting updatedb again will update your present db and reflects the changes on the fs.

share|improve this answer

In a similar situation (differential backup) I do this first:

find /directory/ -printf . &>/dev/null

This way I get all the file metadata into the cache with optimal hard disk performance (would probably not make much sense with an SSD).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.