Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

People seem to have already asked about indexing file system:

What options are there for indexing my filesystem?

Alternatives to OS X's Spotlight?

but I want to actually just index a certain working directory and be able to do that manually (so that I make sure my search is correct). Basically, I am on working a project and I need be able to search in contents quickly. I already use 'locate' and 'updatedb' commands, but those search for file names only. I am looking for similar commands but file contents.

Just in case you are wondering why I don't use tracker also like answered in the two posts, tracker have a set of prespecified folders to search in them, and whenever you make a search, you search in all of them. What I want is to be able to search in every project separately.

share|improve this question
what kind of projects are you trying to index. are they docs or code? – binW Dec 28 '10 at 6:59
up vote 5 down vote accepted

You can try recoll, it is available in the repositories, it gives you a lot of control over the folders you want to index and search and where you want to store the index database, you can use multiple databases too, you can use the advanced search to return results from a specific folder.

See some of its features here:, You can run it from the command line passing the query and other control terms to it, see the short manual here; The full manual is here;

share|improve this answer
That seems to be great, I will give it a try. – Rafid Dec 28 '10 at 9:44

You can use ack-grep (a cli tool), it mainly useful for code projects if that's your use case.

share|improve this answer

There's always google desktop - if you can bear the thought.

share|improve this answer
Like I said in my question, I want the search to be for a specific folder, and can be manually updated. Google desktop search all the hard drive, and cannot be manually updated, so if I don't find something in it, it doesn't necessarily mean it doesn't exist, especially when it comes to programming when you are supposed to always make edits. – Rafid Dec 28 '10 at 9:43

Your Answer


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.