Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Do you know any way to speed up file searching with a shell?

There is a lot of possibilities: find, which, whereis, ...

find seems to be the most useful, but it's very slow. Perhaps, I don't know the best way to use this functionality. How to find files faster?

share|improve this question

migrated from stackoverflow.com Mar 28 '12 at 4:44

This question came from our site for professional and enthusiast programmers.

    
Probably more appropriate for Super User –  Doug Harris Mar 25 '12 at 1:47
add comment

1 Answer

which and whereis search for executables in your path - that's a pretty significant limitation if you're looking for something other than a program.

find does have lots of flexibility, but it executes the search when you run it without the help of indices.

locate works more quickly because it uses an indexed database of files. The down side to this is that it won't find files that are newer than the last database update. The db update is typically done regularly via a cron job.

share|improve this answer
add comment

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.