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.

  • 3
    What about locate?
    – ghm1014
    Feb 28, 2013 at 22:03
  • Isn't this just a software recommendation request? Aug 5, 2015 at 1:06

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.


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).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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