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 have a large directory tree of source files. I want to search around all these files. My first instinct is to use grep -R or ack, but either way they just sequentially read all the files.

Is there some lightweight programme that I can install that will scan all the files once, build and index, and then at any later date I can search for certain words? That should be quicker than just doing loads of grep's. The files I want to search won't be changing, so I don't need something that will index files automatically.

I'm not looking for something that will scan all the files on my harddrive, and i want something locally that's easy to install and set up on a local desktop machine, for simple almost throwaway searching.

Bonus points if the software in the normal ubuntu repositories.

Ideally I want something that's as easy to use as this:

sudo aptitude install supersearch
cd /path/to/where/I/wanna/search
supersearch --make-index 
supersearch "foo bar"
share|improve this question

2 Answers 2

Sounds like you want Beagle. Its main purpose is as a comprehensive desktop search, but you can tell it to just look at the source tree you want to index.

share|improve this answer

I believe Tracker is installed by default on Ubuntu. Do man trackerd and man tracker-search for more info.

From the trackerd man page:

By default, trackerd will index all files in a user’s home directory
(with the exception of hidden files). This can be overridden by speci‐
fying one or more directories to be indexed instead in the configura‐
tion file ($HOME/.config/tracker/tracker.cfg) and/or by using the
--include-dir option to specify other directories to be indexed.

share|improve this answer

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.