In this article, I will give you a quick overview of the best tools for textual search in your files on Mac.
If you need to search the text of your documents in a folder on your Mac, I recommend SeekFast - a powerful tool that allows you to search for keywords in all documents in a folder. It uses intelligent technology to display the most relevant results first.
SeekFast supports all kinds of commonly used documents: Microsoft Office, PDFs, OpenOffice, LibreOffice, email files, many kinds of text files, and others.
Search for word combinations
One of the main advantages of SeekFast over all other search tools is that it can search for combinations of words, no matter where they occur in a sentence.
Furthermore, SeekFast ranks results by relevance, which allows you to instantly see the text you need among hundreds or thousands of results.
Easy review of the found text
Another essential advantage of SeekFast is that you immediately see the text of all sentences in which the search words occur, which helps you easily navigate among the results. When you click on the corresponding sentence, SeekFast opens a larger part of the text without you having to open the file.
How to use SeekFast
- Download and install the application.
- Click on the "Browse" button to select the desired folder.
- SeekFast will load the folder’s contents. It might take some time depending on its size.
- Once the folder is loaded, it will be added to the search history. You can access any previously read folder from the dropdown list and it will be loaded instantly.
- Type your search terms and press the "Search" button or hit "Return" key.
- SeekFast will present all the matches wrapped in passages. You can click on each passage to view the whole text.
SeekFast offers a free version allowing you to search in folders with up to 50 files.
- Search both file names and file contents.
- You can see all sentences containing your searched words.
- View highlighted results in context without opening them.
- Search for combinations of words, contained in any place in a sentence.
- The search algorithm can order the results by relevance.
- Supports a wide range of different file formats.
- One license can be used on 3 devices and is valid for both Mac and Windows machines.
- You cannot search more than 100,000 files at once.
2. Finder and Spotlight
Introduction to Finder
With the help of Finder you can easily search for text in the contents of the files in a given folder. This is done as follows:
- Open Finder and navigate to the folder you want to search.
- In the toolbar below the search box, you have two search options: "This Mac" or the current folder. Click on the name of the current folder.
- Type your search word in the search box.
- Click on the file name in the search result to see a thumbnail of the document.
This is a very brief introduction to searching with Finder, but the tool also has many advanced features, which you can learn in detail in the article How to Search on Mac with Finder.
Spotlight - a universal search tool for Mac
Spotlight is a built-in desktop search tool for Mac that searches not only in your files, but also in the history of the visited websites and other sources. The purpose of Spotlight is to be a universal search tool, which always searches throughout the whole system.
However, with Spotlight you cannot narrow the search. You cannot search the files in a specific folder, which in some cases is a big inconvenience – when there are a lot of results, it will be quite difficult for you to find the document you are looking for.
Using Spotlight is similar to using Finder:
- Open Spotlight from the magnifying glass in the upper right corner of the screen.
- Type your searched word in the search box.
- Click the file name in the search result to see a thumbnail of the found document.
With Spotlight you can specify the type of the file you are searching for - text, picture, movie, music or application. You can also search by file extension, date, author or publisher name. For a detailed guide to these options, see the article How to Search on Mac with Spotlight.
- No need to install additional software.
- The search is quick and easy.
- You can view a thumbnail of each document found.
- You can search by date or period.
- You cannot see the text of the found documents without opening them.
- You cannot see the sentences containing the search terms.
- You cannot search for word combinations.
- The results are not ranked by relevance.
3. Path Finder - an advanced alternative to Finder
Path Finder is a file manager that has a similar interface to Finder but offers much better control over your file system, allowing for more precise and easier searches with its dual panels, folder navigation, advanced sorting and filtering, hidden file manipulation, and much more.
You can access any folder in the hierarchy by clicking on it in the path navigator:
Similar to Apple’s Finder, Path Finder has a Search Bar, from which you can search for a file by typing your keywords.
Click on the magnifying glass to bring up a window that will show your latest keywords and some search options.
Click on the "Dual Browser" button if you want to show a second window. That way you will be able to access two different directories or make two searches simultaneously.
- Interface featuring dual pane view.
- Path navigator.
- Customizable commands.
- Batch operations.
- Temporary drag and drop stack.
- Paid monthly subscription.
Marta is a free alternative to Finder and offers some common utilities that improve the overall searching experience: dual panel split view, folder navigator, and integrated Spotlight search. Marta’s biggest advantage is that its appearance is fully customizable through a configuration file.
Although Marta lacks the usual interface for configuring preferences, you can find a simple and detailed guide for it in the official documentation.
You can download Marta or just use the command:
brew install --cask marta
in Terminal if you already have Homebrew.
- Fully customizable interface.
- Dual panel split view.
- Folder navigator.
- Completely free.
- Lacks interface for configuring preferences.
5. Search by Terminal
You can search your files using Terminal commands as well. It is not as user-friendly as Spotlight or Finder but allows you to make detailed searches across your whole system, including the hidden files.
Search text in files with the "Mdfind" operator
There are several commands you can use to search in your system. The fastest and easiest one is "mdfind" - a command-line interface for Spotlight. Here is how to use it:
- Open a new Terminal window from Applications –> Utilities.
- Type "mdfind" followed by a space and your search term. For example:
- Press "Return."
Terminal will display a list of files with their full directories that contain the search term.
Advanced search with the "Find" operator
Another useful command is "find," which can perform a deeper search and can accept more parameters (search directory, file type, etc.). Its Linux counterpart is very similar, so if you already have experience with it, you can operate it in the same way.
Note that the "find" command requires root access, so the steps to use it are:
- Open Terminal and switch to your root user account by entering
sudo su -
- Press "Return."
- Enter your device password.
- Use the "find" command with the following syntax:
find directory_name -name file_name
Replace directory_name and file_name with the respective values you need.
find /Users -name fish – searches across all of your files in the "User" directory that contain the word "fish" and if there are any, display their full path locations.
You can ignore any entries containing warnings, such as "Operation not permitted" or "Not a directory."
To exit from your root account, just press Command+D.
Search in system files with the "Locate" operator
The "locate" command is very useful for developers. It searches in all system files and ignores user directories.
Here is how to use it:
- Open Terminal and write the following command:
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist – this generates a database with system files, which will take some time, but after that it will be updated automatically.
- Type "locate" with a file name parameter:
Finally, if you want more advanced searches, take a look at the "grep" command. It supports numerous properties including regular expressions. It is visibly slower than the GNU grep used on Linux; thus, if you want to use the latter, you will need to install it with Homebrew.
You can read more comprehensive and useful information about using the "grep" operator in our article How to Search Text in Multiple Files in Linux.
HoudahSpot is yet another good option to search for text in multiple files on macOS. It uses the Spotlight index, but presents the results in an improved user interface to make search easier.
In addition to the regular search, it allows you to combine various criteria. You can use this tool to search text with the following steps:
- Download and install it on your Mac. Launch HoudahSpot.
- Choose the folder to search from the "Locations" section on the left side of the main window.
- Type your desired words in the “Search Any Text” field and click Return.
- In the Info pane, click on the "Text Preview" icon to see the text found.
- You can refine your search with multiple filters.
- You can search multiple folders at once.
- It highlights the text you searched for.
- You can set templates for recurring searches.
- You cannot view all the sentences containing the searched terms at once.
- HoudahSpot is dependent on Spotlight, so you cannot use it if Spotlight indexing is disabled.
- Does not have a free version.
DocFetcher is another application that can search the contents of the most common file types.
Here is how to search text documents using it:
- Download and install DocFetcher.
- Right-click the "Search Scope" field and choose "Create Index From" -> "Folder" to add folders to the search.
- Type your keywords in the Search field and hit "Return."
DocFetcher will show any matching results for each file.
- Search file names and file contents.
- Highlighted results.
- You can use various filters such as by file format, document size, and location.
- Completely free.
- The interface is not very intuitive.
- It is dependent on Java Runtime Environment (JRE), so you will need to have it installed.
- You will have to click on each file name to see the text.
- You cannot search for combinations of words.
I hope this guide was comprehensive and useful enough for you.
Now I would like to hear your opinion – which search software for Mac does the best job for you? Would you like to add something or have a question?
Please share your opinion in the comments section below.