Find files and directories with FSearch
Why FSearch?
So what makes FSearch such an excellent search tool? First and foremost, probably the speed. By default, the software starts searching as soon as you type the first letters of the search word and usually finishes displaying the matches before you complete the search term (in case you are wondering why the search button can be turned off). This instant search simply makes an additional button superfluous in the default setting.
The matches can be sorted at the top of the results list by file name, path, size, or modification time. However, the software does not support full-text searching; it only searches for the names of files and directories. If you need full-text searching, try Recoll or DocFetcher.
In the settings (Figure 3) below Database, you can include or exclude paths or hidden files and folders from the search. For example, you can use a wildcard to exclude all files with "flatpak" in their name by specifying flatpak*
(Figure 4). If you are including a wildcard, a checkbox labeled One Filesystem appears after each entry (otherwise it is grayed out), which lets you exclude a network drive that may or may not be mounted in /home
from the search.
You can extend the predefined filters for file types such as Folders, Files, Pictures, Documents, or Audio, with your own filters in the settings on the Search tab (Figure 5). However, the search can also be narrowed down even further in the search mask by entering ~/documents pdf
, for example. If you know the file name, ~/Documents Li
will find all documents with this combination of initial letters.
If you enable the Search in path when query contains path separators option in the Search tab, FSearch will recognize when you want to follow a path. If you enter home
in the search mask, the result shows all files with home
in the name. By adding the path separator to the term (e.g., home/)
, the software performs a path search.
The Behaviour after successfully opening a file option (Figure 1) with Minimize or Close selected from the drop-down list proves useful if you only intend to browse for a file, open it from the context menu, and then process it elsewhere.
New Operators
The developers updated the search engine in FSearch 0.2. The syntax now offers many more possibilities than before. Operators and functions can be used to specify the search term or you can extend it using wildcards. In addition, the search evaluates regular expressions, based on the Perl Compatible Regular Expressions (PCRE) library.
Like previously, FSearch interprets a space in the search term as an AND. For example, if you are looking for all occurrences relevant to AUTH in the /var
directory, type /var auth
. If you don't select Match case when query contains at least one upper case character (Figure 5) in the Search tab, FSearch will find both "AUTH" and "auth" (Figure 6).
You can also use the new operators to specify match criteria such as size, modification date, folder depth, extension, content type, and much more. For example, to find any MP4 file larger than 1GB, you would type
ext:mp4 size:>1gb
The program also lets you create queries with the OR and NOT operators. For example, to find all JPEG and PNG files modified last month with "cat" or "dog" in their name, type:
(cat OR dog) ext:jpg;png dm:lastmonth
On GitHub, the project explains the extended syntax and provides a couple of examples [8].
Outlook
Boxdörfer provides users with a sneak peak of planned extensions and the versions in which they will be incorporated into FSearch on GitHub [9].
In the near future, he plans, among other things, to introduce live updates of the database and to use inotify
to automatically detect changes to directories or files [10]. In addition, it will be possible to filter for certain file types during indexing according to properties such as file size or last change.
FSearch 0.5 is expected to support bookmarks as well as a search history, and version 0.6 is expected to show thumbnails for supported file types. An implementation for the command line is also on the roadmap. That would make it easier to write extensions for KDE's KRunner, for example.
« Previous 1 2 3 Next »
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Gnome 47.1 Released with a Few Fixes
The latest release of the Gnome desktop is all about fixing a few nagging issues and not about bringing new features into the mix.
-
System76 Unveils an Ampere-Powered Thelio Desktop
If you're looking for a new desktop system for developing autonomous driving and software-defined vehicle solutions. System76 has you covered.
-
VirtualBox 7.1.4 Includes Initial Support for Linux kernel 6.12
The latest version of VirtualBox has arrived and it not only adds initial support for kernel 6.12 but another feature that will make using the virtual machine tool much easier.
-
New Slimbook EVO with Raw AMD Ryzen Power
If you're looking for serious power in a 14" ultrabook that is powered by Linux, Slimbook has just the thing for you.
-
The Gnome Foundation Struggling to Stay Afloat
The foundation behind the Gnome desktop environment is having to go through some serious belt-tightening due to continued financial problems.
-
Thousands of Linux Servers Infected with Stealth Malware Since 2021
Perfctl is capable of remaining undetected, which makes it dangerous and hard to mitigate.
-
Halcyon Creates Anti-Ransomware Protection for Linux
As more Linux systems are targeted by ransomware, Halcyon is stepping up its protection.
-
Valve and Arch Linux Announce Collaboration
Valve and Arch have come together for two projects that will have a serious impact on the Linux distribution.
-
Hacker Successfully Runs Linux on a CPU from the Early ‘70s
From the office of "Look what I can do," Dmitry Grinberg was able to get Linux running on a processor that was created in 1971.
-
OSI and LPI Form Strategic Alliance
With a goal of strengthening Linux and open source communities, this new alliance aims to nurture the growth of more highly skilled professionals.