Open Source

SolutionBase: File searching made easy with Linux

If you're using Linux as a desktop operating system, you're not stuck using command line tools in order to find data. Jack Wallen examines some outstanding Linux tools that should make your searching simple.

One of the major innovations claimed by Microsoft in Windows Vista was its improved searching and integrated search bar. Likewise, Apple has been touting Spotlight for desktop search in Mac OS X. If you're using Linux as a desktop operating system, you're not left out in the cold, nor are you stuck using command line tools in order to find data on your Linux workstation.

There are some outstanding Linux tools to make your searching simple. We'll examine the GNOME Beagle search tool, the KDE search tool Kfind, and the Google Linux Desktop.

Beagle

Beagle is a tool that will, as described from the official Beagle Web site, "Ransack your personal information space to find whatever you're looking for." Beagle does so, but with a bit more panache than you'd think. For one, Beagle works in conjunction with the Linux kernel's inotify, which is a kernel-level file notification system that remains aware of any file change.  

If you are running a recent version of GNOME, you won't have to worry about installing Beagle; it's already there. Using Beagle is very simple. The first thing you are going to do (in the GNOME Desktop Environment) is to go to the Places menu and select "Search" (as shown in Figure A).

Figure A

It couldn't get any simpler.

This will open up the main Beagle window (shown in Figure B). The Beagle main window has but one function, search for files. You enter the string you are looking for in the Find bar and press Find Now or [Enter].

Figure B

The tips are pretty much the same for any Web search engine.

When you start up Beagle more than just a front-end for a command starts up. If you run ps when the Beagle main window is open, you'll see more than just Beagle running. Take a look at Figure C. Notice (when running ps aux | grep Beagle) that there are three entries: Beagle Daemon (Beagled), Beagle Search (Beagle-search), and the ps command just run. This shows that Beagle does have a background daemon running.

Figure C

Looks like someone forgot that .exe commands belong in the Windows world.

Unlike the Linux Google Desktop (which we'll chat about later), Beagle doesn't automatically index your entire system. What it does do is index your ~/ directory. So starting up Beagle for the first time will not take hours to complete. However, this does mean, upon first start, the only indexed files are those in your ~/ directory. This, of course, doesn't help those of us who store files on separately mounted drives or in other non-standard directory structures. For that, you will have to tell Beagle where to look.

To do so, open Beagle and go to the Search menu, and select Preferences. Within the Preferences window (see Figure D below) you'll see two tabs (Search and Indexing). Press on the Indexing tab to reveal the location of the indexed directories.

Figure D

You will definitely want to have the Start search & indexing services automatically checked.

Within the Indexing tab, shown in Figure E, you'll see that Index my home directory is checked by default.

Figure E

If you do not keep files in your ~/ directory, you can uncheck the Index My Home Directory check box.

This is good, but we want Beagle to index more locations. To do that, press the Add button which will open up a window where you will navigate to the directory you wish to add. You'll see this in Figure F.

Figure F

It would not be wise (unless you are running as the root user — which you are not) to add the entire filesystem to the indexing.

Once you have located the directory you want to index, press Open to add it. Depending on the size of the directory you have just added, Beagle could take quite some time to index your files (even hours). So you might want to go about your normal business while Beagle takes care of its business. Of course, there is no notification that Beagle is done indexing your new directories.

I added my /data directory which is a 40 GB drive mounted on the /data partition currently 93 percent filled with data. Once I added this directory to Beagle, it took less than five minutes to index the entire contents of the drive and Beagle to start showing me results from searches.

To do a search in Beagle, simply type in the string you're looking for and do one of the following three things: Press [Enter], select Search, or stop typing. You can also easily configure how results are sorted. To do this, select View and then select the option you want.

Another way to search with Beagle is to add a search button to your panel. This just adds a shortcut to the Beagle main window so you don't have to run through the Places menu. It would be nice if the developers just added a text entry window for the panel so you could type in the word you are looking for, and Beagle would pop up the results.

Beagle is a great search feature that works exactly as it should. Now let's move on to KDE and see what it has to offer.

KDE searches

Searching in KDE is not quite as advanced as Beagle, but it's as intuitive as one would expect in the user-friendly world of KDE. The application used is called Kfind.

Kfind has a problem: it's not an indexing search tool. In other words, when you go to search for a file, Kfind starts from the beginning and rescans your system. So if you're searching a rather large file system for a file that starts with a "z" and the file is located in a directory that starts with a "z", you might have a while to wait. Of course, you can narrow your parameters; but, if you have no idea where to begin (and thus can't narrow your parameters), you're just going to have to wait.

There are two ways to run Kfind. First, from within the Konqueror browser, you can hit [Ctrl]F to add the Kfind applet within Konqueror, as shown in Figure G.

Figure G

Now Konqueror has a find applet added.

Once the Kfind applet has been opened within Konqueror, a search is simple. It will look as if there is an "indexing" option, but what it really does is tell Kfind to use the locate database. This is not really the same as a more modern search indexing feature, but the locate database is generally updated daily, so it does at least keep track of what has changed.

You can also do your Kfind searches without the help of Konqueror (at least initially) by adding the Kfind applet to the Kpanel. To do this right, select the Kpanel and select Add Applet To Panel. A new window will appear where you will scroll down until you reach Find, as shown in Figure H.

Figure H

Highlight Find and press Add to add the Kfind applet to the panel.

Now when you press the Kfind button on the panel, a submenu will appear, offering you two choices: Find Files and Web Searches. Selecting Find Files will open up the Kfind application. If you click on a Web Search, Kfind will open up Konqueror to www.google.com.

Google Linux Desktop

GLD is the Mack Daddy of Linux file search tools. This tool is not only the easiest to use, it's the fastest (once it's indexed) and most reliable. It's simple to install: Download the required file from the Google Linux Desktop page and install it. I am using Fedora, so I will install the rpm with the command rpm -ivh google-desktop-linux-1.0.1.0060.rpm.

Once installed, though, I was a bit confused at how to start the tool. In KDE, I found a menu entry for the Google Desktop, but selecting the entry didn't actually start anything. It wasn't until I stumbled across a keyboard shortcut within either Firefox or Konqueror that I saw Google Desktop in action.

With either browser open, if you double-click [Ctrl], the Google Desktop tool will appear, as shown in Figure I.

Figure I

Enter your search parameters and press [Enter] to see the results.

Once you enter your search string, do not press [Enter]; let the Google Desktop show you the initial results first, as shown in Figure J. In order to see the complete results of your string, you will want to select See All Results In A Browser.

Figure J

If you select Search More, you will multiple search options for your string.

You can also customize your Google Desktop experience. From the KDE menu, if you go to the Google Desktop submenu, you'll see two entries: Google Desktop and Google Desktop Preferences. Select the latter to open up the GLD Preferences window.

One of the first configurations I took care of was to change the default action of the Quick Search box, which is found in the Display tab. I am not sure why the developers of GLD made Search The Web the default action; it makes no sense. Instead, I changed that to Search Desktop.

The rest of the Google Linux Desktop preferences are all straightforward. The only option which might need addressing is the Advanced Features under the Other tab. This is one of those features that I would recommend you shut off immediately. Keeping this feature enabled allows GLD to collect "non-personal" information and send it to Google. (No thank you; Google doesn't need to know that much about me and my computer.)

Final thoughts

Did you think Linux was only a collection of antiquated command lines? Shame on you. As you can see, the Linux desktop is full of outstanding search tools. With Google Linux Desktop being the most popular, the other graphical options are not far behind.

Of course, I still tend to stick with Find and Locate; but, with Google Linux Desktop on my system, the days of command line searches might just be fading fast.

About Jack Wallen

Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website jackwallen.com.

Editor's Picks

Free Newsletters, In your Inbox