1. Finding files containing a specific string with GNOME GUI tool gnome-search-tool
Default installation of GNOME version 2.x and 3.x is equipped with a tool called gnome-search-tool. The tool is used by default in the GNOME's file explorer program Nautilus. The quickest way to look for a certain text string across all the files located in a directory and show them is with nautilus's – find manager.
Below is a screenshot showing the gnome-search-tool embedded in nautilus
Nautilus find uses gnome-search-tool program for its file search. Below is a screenshot showing the gnome-search-tool embedded in nautilus:
The gnome-search-tool can be also invoked through Gnome Run Application with ALT+F2 or directly run from terminal e.g.:
hipo@noah:~$ gnome-search-tool
As you can see in below screenshot, gnome-search-tool has many available filter file search criterias.
You see I wanted to look for my project passwords so typed in pass in Contains the text: field and pressed enter to simply look for this text in all my files in the look in folder RichtooRich
Actually gnome-search-tool offers plenty of more options than one might look for. With it one can easily make a combination of complex search critea (filters) and hence a very versatile Desktop file saerch tool. From testing it I can say it for sure more powerful program than MS Windows default file searching program called Find It – this is the program with the ( "dumb dog holing a magnifier" 🙂
One can use the Add or Remove to Add single or various combination of filter criterias. For the sake of testing it, I've added a number of file search filters as you see in the shot below:
The search critias are not matched and therefore 0 files were found.
In case if you wonder how gnome-search-tool works? It is actually a GUI wrapper to Linux's Linux find command .
I wasn't complete sure if it uses find for the file search, so to check I run a one search and in in console ran:
hipo@noah:~$ ps axuwf|grep -i find
hipo 18213 2.0 0.0 25568 1276 ? S 23:55 0:00 find /home/hipo/Richtoorich ( -iname * -o -iname .* ) ! -type p -exec grep -i -I -c test {} ; -mtime -1 ( -size 102400 -o -size +102400 ) -user root ! -iname *bad\-name\-to\-omit* -print
You can see the filters set in gnome-search-tool are passed as command arguments to find.
2. Finding files containing a string recursively in KDE with kfind
For KDE users there is a handy little tool called Kfind. Kfind is less "search customizable" if it is compared to gnome-search-tool but it has advantage that its search options are way more "user friendly" / human readable 🙂
To use the tool to look in all files for explicit string fill in Look in: or browse to set the main directory where it will look for the string.
Then in the second Contents (tab) fill in the Containing Text: with the string to be looked for:
Finally in the Names/Location tab, there are two other helpful search options – Show Hidden Files and Case Sensitive Search
I'll be curious to hear if someone knows some other nice software easy and comprehensive to use for Linux / BSD. If you know a better file searcher for Linux than this kfind or gnome-search-tool please drop a comment.