Power searching Linux with SearchMonkey
There are search tools and then there are SEARCH TOOLS. Any Linux user that has ever needed real power for their searches generally has to resort to the command line where they can take advantage of regular expressions or scripting. But what if you could have a GUI tool that could also handle regular expressions?
There is such a tool - SearchMonkey. SearchMonkey attempts to bridge the gap between Beagle and locate/find by adding a powerful regular expression builder to a GUI searching tool. And SearchMonkey does quite well at this task.
In this article you will learn how to install SearchMonkey and use its powerful regular expression builder to power your searches.
Installing
As you have come to expect, installing SearchMonkey is simple:
- Open up the Add/Remove Software application.
- Search for "searchmonkey" (No quotes).
- Select SearchMonkey for installation.
- Click Apply.
- Enjoy.
Once SearchMonkey is installed you will find it in the Accessories sub-menu of the Applications menu.
Using SearchMonkey
When you fire up the SearchMonkey tool the main window will appear (see Figure 1) with three tabs: Basic, Advanced, and Options. For standard searching the Basic tab should be fine. You can not add regular expressions to the Basic tab. Only within the Advanced tab can you take advantage of regular expressions in your searching.
And since anyone can use a basic search GUI, let's skip right to the good stuff within the Advanced tab.
Advanced searching
When you click on the Advanced tab you will see the regular expression builder right away (see Figure 2). As you can see you can apply regular expressions to the both the file name and the file contents. Let's walk through the process of creating a regular expression for a search. I want to search all files within /home/jlwallen for any file containing the phrase "Figure" more than once. To do this click on the Expression Builder button for the "Containing" section. When this is clicked this it will open up a new window where the expression can be built.
Here's how we build our expression. Since our expression will only apply to the contents of the files click the Expression Builder button for the "Contains" section. When the new window appears (see Figure 3) immediately go to the "Text contains" section and select "The phrase" from the drop down. In the text area immediately to the right of that drop down enter  "Figure" (no quotes). Now select "One or more times" from the "Occurs" drop down. The expression is built, it now has to be added by clicking the "Add" button.
This is where the behavior gets a bit odd. After you push the Add button you have to put the OK button to add the expression to the main search window. The problem is, by pushing the OK button your default web browser will open to the SearchMonkey web page. This has nothing to do with your searching. You can close your web browser (or the tab SearcMonkey opened) without any effect to SearchMonkey. After the web page opens, go back to the SearchMonkey window and click Cancel which will take you back to the main window. Now you should see, the "Containing" section the string "(Figure)+" (no quotes). That is the expression to find all files that contain the string "Figure" (no quotes).
Click Start and you will quickly see the results pile up (given your file system contains files that match the expression.) Depending upon the size of your hard drive, the amount of files/folders on your machine, the complexity of your regular expression, and the speed of your machine the search could take some time.
Final thoughts
That gives you an idea how SearchMonkey is used. If you're looking for a search tool that gives you far more power at your fingertips than the standard fair, SearchMonkey might be the perfect solution for you. Not only can you search your entire file system, you can create some fairly complex regular expressions to add power to your searching.
Hi Jack,
I am the developer of Searchmonkey – thank you for taking the time to put up this excellent how to guide.
I just wanted to take this opportunity to announce there are new versions of
Searchmonkey ready to download on the sourceforge website. Some of the cool new features are added support for advanced text files such as PDF, DOCX, DOC, ODT, and much more besides.
Furthermore, we are now working on two new members of the Searchmonkey suite. The QT version will provide native support for KDE desktop users. The JAVA version will provide a tool for users on the more exotic platforms such as Windows!
Once again thanks for the great guide on using Searchmonkey – I hope that these new features will enable more people to benefit from Open Source.
Kind regards,
Adam – Searchmonkey founder