Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to quickly search my entire filesystem for a string. Is there a program that will index my disk and allow me to do this? I've tried tracker and google desktop, but they don't seem to allow me to recursively index root (/).

share|improve this question
    
What exactly is your use case? Are you trying to find a filename containing a string, a file containing a string, or just that string anywhere on the disk (including slack space)? –  Scott Pack Jan 14 '11 at 2:59
    
file containting a string –  Michael Gummelt Jan 14 '11 at 4:23
add comment

3 Answers

up vote 5 down vote accepted

Do you need to quickly search your filesystem for a string just once? Or is this something you need to do all the time? Because if it's just once, you might as well just use grep -- the time it takes grep to search through everything won't be any slower than the time it takes to build an index.

If this is actually something you find yourself doing regularly, then you'll find a number of full-text indexing tools out there, including swish-e, Lucene, Sphinx, and others.

share|improve this answer
add comment

find / -type f -exec grep PATTERN {} \;

If this is a workstation, you might want to look into Beagle[0] or whatever it is that has since replaced Beagle.

[0] http://beagle-project.org/Main_Page

share|improve this answer
add comment

You may find ack to be particularly useful. It combines the find and grep into one tool and searches files selectively based on their type or regexes you provide. It's geared toward source code, but you can have it search all files. The package name in Ubuntu (and Debian) is "ack-grep".

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.