PDA

View Full Version : [SOLVED] 12.04 -Unable to search for words WITHIN files



Loerie
June 14th, 2012, 08:01 PM
Lucid (10.04) had a search option:
'Search for Files', then 'select more options'
which enabled the search for words/strings WITHIN files.

Where can I find this in 12.04?

The 'search file' in the filemanager only searches for filenames.
The 'dash' does not return anything for search, find etc.
A search in the forum did not yield a result which would answer above question.

Thanks!

cocojuco
June 19th, 2012, 10:53 PM
Hi,

I spent quite a long time to find the answer, but finally I found it :-)

The apparent name of the application is "Search for Files", as indicated in the header of windows of the application. But its real name is gnome-search-tool (if you still have this application working somewere on an old Ubuntu, it can be found by opening the help menu, Settings, and looking for 'key name'). Once this name is known, I can easily be installed by any usual way, including from the software center or synaptic.

I am very surprized that this handy and efficient tool was removed in Ubuntu 12.04 without any equivalent tool.

I hope this will be helpful !

sudodus
June 20th, 2012, 01:20 AM
For those who can stand terminal window commands there is grep.
grep [OPTIONS] PATTERN [FILE...]

Read
man grep for details.

Or combine grep with find to recursively search all files for a string
http://www.cyberciti.biz/faq/howto-recursively-search-all-files-for-words/ (http://www.cyberciti.biz/faq/howto-recursively-search-all-files-for-words/)

find command is recommended because of speed and ability to deal with filenames that contain spaces.

cd /path/to/dir
find . -type f -exec grep -l "word" {} + # print only filenames
find . -type f -exec grep "word" {} + # print each matching line

Also have a look at Recoll which is quite advanced and can search in several file types.
http://www.lesbonscomptes.com/recoll/ (http://www.lesbonscomptes.com/recoll/)
It is in the Ubuntu repositories and is installed by

sudo apt-get install recoll

Loerie
June 23rd, 2012, 08:00 PM
sudodus,

Recoll works very well!

Terminal window commands are bit intimidating for me at the moment, so I will check them out once I know what I am doing, LOL!

Thanks again!

cocojuco,

I am very surprised that this handy and efficient tool was removed in Ubuntu 12.04 without any equivalent tool
I agree with you 1000% !!!!

sudodus
June 23rd, 2012, 08:11 PM
If you are happy with the solution, please click on Thread Tools at the top of this page and mark this thread as SOLVED :-)

amr-maro
June 26th, 2012, 01:21 PM
Install "gnome-search-tool", which is the "Search for Files" tool.

Loerie
July 2nd, 2012, 10:42 PM
Great work, amr-maro, thanks! :KS

I downloaded gnome-search-tool (with hyphens) through the Ubuntu SW center and locked it to the launcher!

I still don't understand why the developers of 12.04 LTS 'forgot' about this essential feature. Is it for a reason?

sriramkannan95
October 21st, 2012, 05:28 AM
"gnome-search-tool" is the one you are searching for! as replied by the others :)