FDE Times dataFDE jobs open 922▼2 Change in open roles over 7 days, like-for-like: roles from companies we started tracking this week are left outNew in 7 days 64Companies hiring 201Remote-friendly 23%Median US pay $202kTop hirer Databricks 113
中文VI

The newspaper of the Forward Deployed Engineer

Tools

An empty ripgrep result does not mean the client's logs are clean

Three tools beat grep and find on speed, but their default filters can hide the very file a forward deployed engineer needs on day one.

ShareLinkedInFacebookX

In brief

  • By default ripgrep skips files in .gitignore, hidden files and binary files, so an empty search proves nothing on its own.
  • fd replaces find and fzf filters interactively; the author of fzf maintains a whole page on pairing fzf with ripgrep.
  • Learn rg first, remember to rerun with -uuu, then move on to fzf and fd.
Layer diagram: the rg command at the top, below it three default filters (.gitignore skipping the logs/ folder, hidden files, binary files, with .gitignore highlighted in orange), and at the bottom the client's logs and code. An arrow bypasses all three layers, labelled -uuu disables all three filters.
By default, ripgrep skips anything covered by .gitignore, hidden files and binary files. The logs/ folder is gitignored, so a search can come back empty. The -uuu flag turns off all three filters.

ripgrep, the search tool written by Andrew Gallant, ignores everything listed in .gitignore by default, along with hidden files and binary files. That is a large part of why it runs so fast on a codebase. It is also why it can go quiet at the very moment you most need an answer.

For a forward deployed engineer, that moment usually arrives on the first day at a client site. You inherit a codebase you have never read, a log directory weighing several gigabytes, and very little time to show where the fault lies. Three tools, ripgrep (rg), fd and fzf, will carry you far faster than grep and find, provided you know exactly what they are filtering out.

One tool, one job

rg searches an entire directory tree for a regex pattern and runs on Rust’s regex engine. The official repository states that it has first-class support for Windows, macOS and Linux. That matters when you do not get to choose the machine: today it is your own Mac laptop, tomorrow a client’s Linux server or Windows workstation.

fd, a repository by sharkdp, describes itself as a simple, fast and user-friendly alternative to find. It walks directories in parallel, can run commands in parallel on each result, and, like rg, skips patterns in .gitignore. fd is dual-licensed under MIT and Apache 2.0.

fzf, by Junegunn Choi, is a general-purpose fuzzy finder distributed as a single binary under the MIT license. Its author says it is optimized to process millions of lines in milliseconds, and it ships with integrations for Bash, Zsh, Fish, Nushell, Vim and Neovim.

If the client runs a security review before you may install tools, have the license details for all three ready.

Where the speed comes from

In 2016 Gallant published a benchmark comparing ripgrep with grep, ag, git grep, ucg, pt and sift. His conclusion: no other tool clearly beat ripgrep on either performance or correctness, and ripgrep achieved that with Unicode support switched on.

Those are the author’s own measurements from 2016, so treat them as a starting point and rerun the numbers on the client’s data.

The benchmark contains one point worth keeping in mind for anyone who reads logs: memory maps are not always faster. Gallant wrote that tools searching many files at once tend to be slower when they use memory maps, so ripgrep picks its reading strategy according to the workload.

One enormous log file and thousands of rotated log files are different problems. When you measure, try both.

When rg finds nothing

Take a hypothetical case. The client’s repo has a logs/ line in .gitignore, because nobody wants to commit logs. You stand at the repo root and search for a connection error:

rg 'connection reset' .
# no results at all

Read in a hurry, this suggests the error is not in the logs, and you start suspecting the network. In fact rg never opened the logs/ directory. The triple flag -uuu switches off every default filter: .gitignore, hidden files and binary files.

rg -uuu 'connection reset' .
# this time rg also searches logs/, hidden files and binary files

Make this a reflex: when a search comes back empty, rerun it with -uuu before telling the client anything. fd also skips .gitignore patterns by default, so when its listing is missing a file you are sure must exist, open .gitignore before concluding the file is not there.

Joining the three with pipes

Because each tool does one job, they are most useful when the output of one becomes the input of the next. fd finds files by name, say every file with config in its name in an unfamiliar repo. Pipe that into fzf and you get a list that narrows with every character you type:

fd config | fzf
rg -uuu 'ERROR' . | fzf

The second command is the pattern you will reach for most, and it keeps -uuu for the reason above: logs often live in gitignored directories. rg gathers every error line, and fzf lets you filter further by service name, error code or timestamp without retyping the regex.

On fzf’s official site, Junegunn Choi maintains a “Ripgrep integration” page explaining how to use fzf as an interactive front end for rg. Read it before writing scripts of your own.

What to learn first

Start with rg, because it is the tool you will use every hour on a client site. Get comfortable writing regexes, and remember the three default filters and -uuu. Next comes fzf, with its integration for your shell and editor. Leave fd for last; rg and fzf are often enough.

For your career, this skill belongs on a CV as a concrete story rather than a line listing tool names. State how many gigabytes of logs you searched to find the root cause, how long it took and which command did it.

In interviews with a live debugging round, typing rg and then checking yourself with -uuu shows the interviewer that you know to doubt your own tools.

Clients do not pay for how fast you type. They need a correct answer about their system, and with rg the correct answer is sometimes just three letters u away.

Was this article useful?

Use with your AI assistantAsk Claude ↗Ask ChatGPT ↗
5 sources
Read next on the roadmap · Stage 1: FoundationsYour SSH link to the client's server drops. Is the job still running?Typing one tmux command before you start a long job means you can reattach to the old session after a dropped connection, so nothing has to run again.