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 (/).
-
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 02:59
-
file containting a string – Michael Gummelt Jan 14 '11 at 04:23
3 Answers
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.

- 43,623
- 14
- 121
- 180
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.

- 164
- 5
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".

- 62,149
- 16
- 116
- 151