How can I quickly search my entire filesystem in ubuntu?
772
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 (/).
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.
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".
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 takesgrep
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.
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
You may find
ack
to be particularly useful. It combines thefind
andgrep
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".