ripgrep-all is free and open source command line tool to search in PDFs, Ebooks, documents, ZIP from terminal. This tool takes a keyword from you and then searches in all files present in the target directory. It can search in almost any kind of file and show you the result. With this tool, you can even search in video chapters and subtitles. The lightning fast search of this tool only requires a search pattern or term along with the destination folder. It shows result on the terminal window and even highlights the occurrence of search term in the output as well.
There are command line file search programs that comes within OS. But they cannot search in files as this tool here does. It precisely reads all the files it finds in specified directory and shows you the results. You can either install it from source or you can use its prebuilt binaries in its GitHub releases. Currently, Windows is not supported but you can use it easily on Linux and MAC. For this post, I will tell you how to use this in Linux. The steps for MAC are similar but you need some technical knowledge.
How to Search in PDFs, Ebooks, Documents, ZIP from Terminal?
Installing and using this tool is not that typical. You just have to run a few commands in order to make it work. After you install it, then you just have to run a single command to start searching in various kind of files. In order to install it, you just run these commands one after another. And in the end, you will have the working “rga” command.
sudo apt install build-essential pandoc poppler-utils ffmpeg ripgrep cargo
cargo install ripgrep_all
Now, you can navigate to the folder in which you want to find something and then run the command like this. You will see that it will instantly list all the files containing the specified term. It organizes the search results based on the files in finds in the target directory. It also highlights the occurrence of the search keyword there.
rga "Search_Term/Pattern" DestinationFolder
Above, you can see the results it produced in my case. There were Word and PDF files in the destination folder and it was able to look for the search term in all of them. In the output, it shows the page number where it encountered the input keyword. No matter what kind of files in the destination folder are. If they are text-based and supported by it then it will list them all.
ripgrep-all is now my default tool to find in different kind of files. If you are looking for a file search tool to search in different kind of files then I will recommend you to use it. Currently, it is for MAC and Linux but you can compile it from its source code to use it on Windows. In MAC, you can use it through Homebrew or you can download the binary release from its GitHub page. However, you will have to manually install other dependencies on MAC to make it work.