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

I am trying to locate an openoffice file which contains some text but I don't know the file name. Is there any possible way to locate said file using the Ubuntu's search file tool? If so how. It seems the search tool under places only looks into plain text files. How should I proceed without using the command prompt?

share|improve this question
you could also use the script i posted in… – user237724 Jan 19 '14 at 21:52
up vote 5 down vote accepted


Install searchmonkey, it's available from the repositories. It's easy enough, but if you still need some help with it, ask me and I'll see if I can figure it out for you.

Command Line

grep -R -i -a -n needle stack

grep is the tool needed to find text.
-R tells grep to search recursively.
-i tells grep to not be case-sensitive.
-a tells grep to treat binary files as plain text files.
-n tells grep to show you the line number where the needle is in the file.
needle is the piece of text you are looking for.
stack is where it should search. Because of the -R parameter you can use a directory here.


grep -R -i -a -n "<html>" Websites

This will search for the text in every file in the folder Websites

I hope my explanation was enough for you to understand the use of all parameters. If not, feel free to ask more in a comment.

share|improve this answer
so there is no GUI tool in Ubuntu for finding files containing text? – Azim Jun 30 '11 at 21:09
Ow xD How should I proceed without using the command prompt?, thought it said How should I proceed using the command prompt?. My mistake, I'll look for a GUI tool. – RobinJ Jun 30 '11 at 21:11
Got one, just tested searchmonkey. Seems to be a great application wich I'll probably be using a lot myself from now on :p – RobinJ Jun 30 '11 at 21:14
thanks for the tip about searchmonkey. However, it doesn't find seem to find any files with my needle. Whereas, the grep command does seem to work. Just trying to find a tool for a friend who is not comfortable with command line operations. – Azim Jun 30 '11 at 21:32
My guess is that searchmonkey isn't able to find it, because it's a binary file... Maybe you've got more succes with this one? – RobinJ Jul 1 '11 at 9:51

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.