ugrep tool is a faster, user-friendly and compatible
grep replacement written in C++11. Let's check how to install
ugrep and how to use the interactive query mode, fuzzy search, and other options.
If you are a terminal user,
grep is a basic tool that you must learn. The
grep command is a filter that prints lines from a file that contain a match for one or more patterns.
grep can help you to find specific output in a log file like the following:
grep 10.0.0.1 server.log
In this post we're going to focus in the
ugrep app, an extension of this tool.
In MacOS, you could use
brew install ugrep.
Or, find your destiny here: https://github.com/Genivia/ugrep#install.
The basic usage is start the interactive query mode and look for a specific text in recursively in sub-directories using plain-text or regex.
💡 Tip: you can add the
--ignore-case argument to make case-insensitive matches.
If you want to see only the files that contains the search term you can use the following arguments:
ugrep -Q --ignore-case --files-with-matches
ugrep -Z3 android
-Z3 matches up to three extra, missing or replaced characters;
-Z+~3 allows up to three insertions (
+) or substitutions (
~), but no deletions (
You can start a query mode with fuzzy search like the following:
ugrep -Q -Z3
Once you started the query mode, you can toggle fuzzy search, list only filenames, or more in options panel pressing
Press the upper case Z to toggle on/off the fuzzy search mode, and
[ to increase and
] to decrease the fuzziness.
Also, you can scroll the result of a search using the arrow keys or
^S, then with
F2 you can open the editor for the file of the current matched text (nano, vim, etc).