I have a folder with subfolders in it and many libreoffice documents (.odt).
I need to find in which one there's a particular phrase.
I tried grep -ir "search phrase here" .
but it only found the search phrase in an xml file.
Is there a way to search in documents that are not plain text files?
Finally, I resolved to using Recoll. It does a good job at finding information in files. Indexing is however slow and takes a lot of resources. This is not a problem if you do not run Recoll as a daemon, but only update the index manually when you're not using the computer.
To install it:
I have the similar problem with OpenDocument (ODT document, OTT template) and Microsoft Word (DOC and DOCX documents, DOT and DOTX templates) files.
Currently, I'm happy with the following Bash script for recursive search:
It shows search results and file-names.
Notes:
odt2txt
(for ODT/OTT),docx2txt
(for DOCX/DOTX),libreoffice-writer
(for DOC/DOT).