Ramblings of an aging IT geek
← Ramblings of an aging IT geek
tooling

i finally stopped reaching for grep

After years of habit, switching from grep and find to ripgrep and fd for everyday code searching.

A mechanical keyboard beside a terminal

I've been typing grep -rn and find . -name for so long that my fingers do it without consulting me. That muscle memory is exactly what kept me from switching for years, long after I knew better. This fortnight I finally made rg and fd the default, and the only regret is how long I took.

The speed is the headline, ripgrep is genuinely fast across a large tree, but it isn't why it sticks. It's the defaults. rg foo respects your .gitignore, skips .git, skips binary files, and shows line numbers, all without flags. Compare the muscle-memory version:

grep -rn --exclude-dir=.git --exclude-dir=node_modules foo .
rg foo

Both find the same thing. One of them I can type without thinking about whether I remembered to exclude the dependency directory that's about to drown the output. fd is the same story for find: fd config does what you meant, with sane defaults and a syntax you don't have to look up every single time.

The old tools aren't going anywhere, and I still drop to grep and find the moment I'm on a box that doesn't have the new ones, which is most of them. But on my own machines, for the day-in day-out searching that makes up most of my terminal life, the friction is just gone. Sometimes the right upgrade is the one that lets you stop thinking about the tool entirely.