Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 2755  / 2 Years ago, wed, july 27, 2022, 12:05:30

I am trying to locate a LibreOffice/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 that the search tool under Places only looks into plain text files. How should I proceed without using the command prompt?


More From » gui

 Answers
4

GUI



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.



Example



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.


[#44383] Friday, July 29, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
theurn

Total Points: 30
Total Questions: 110
Total Answers: 111

Location: Bahrain
Member since Fri, Sep 16, 2022
2 Years ago
theurn questions
Tue, Apr 5, 22, 14:18, 2 Years ago
Mon, Feb 14, 22, 16:29, 2 Years ago
Sat, Apr 8, 23, 05:26, 1 Year ago
Tue, Jan 10, 23, 23:59, 1 Year ago
Fri, Apr 8, 22, 01:36, 2 Years ago
;