HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
BurntSushi
ripgrep
Rust2016–2026
BurntSushi / ripgrep

ripgrep

ripgrep recursively searches directories for a regex pattern while respecting your gitignore

196Distinct people
333Mentions
9Explicit recommenders
69.9KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

ripgrep recursively searches directories for a regex pattern while respecting your gitignore

GitHub

Where it is used

  • Visual Studio Code — Visual Studio Code uses ripgrep to power its text search feature, making searches faster. This integrates ripgrep as the engine behind VS Code’s search. Source
  • Eclipse Theia — Eclipse Theia installs and uses ripgrep under its install directory (resources/app/lib/backend/native/ripgrep), requiring extensions to point to that location because Theia places ripgrep in a different directory than VSCode. Source

What people are saying

> I wrote about how to do error handling without libraries literally the day Rust 1.0 was published: https://burntsushi.net/rust-error-handling/ > > That blog did include a…

osiris88 used a recommendation phrase. 9 indexed comments match. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 9–Nov 16 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/16/2026, 6:28:55 AM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year333 dated mentions

Observed mentions: 2016-09-23 15:29:58 UTC to 2026-10-05 14:38:02 UTC.

010203040502016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 25 mentions; 1 submissions, 24 comments20162017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 34 mentions; 3 submissions, 31 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 41 mentions; 5 submissions, 36 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 41 mentions; 1 submissions, 40 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 45 mentions; 3 submissions, 42 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 37 mentions; 2 submissions, 35 comments20212022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 29 mentions; 1 submissions, 28 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 32 mentions; 3 submissions, 29 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 14 mentions; 2 submissions, 12 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 21 mentions; 3 submissions, 18 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 14 mentions; 4 submissions, 10 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC25124
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC34331
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC41536
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC41140
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC45342
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC37235
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC29128
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC32329
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC14212
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC21318
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC14410

What Hacker News says

14 sources
My non-built-in CLI utility recommendations, none of which are macOS specific: * atuin - TUI for shell history, backed by SQLite - https://github.com/atuinsh/atuin * LSD (LSDeluxe) - rewrite of `ls` - https://github.com/lsd-rs/lsd * ripgrep - https://github.com/BurntSushi/ripgrep * fzf - command-line fuzzy finder that enhances file search, command history search, and more - https://github.com/junegunn/fzf Notes: - To get pretty extra file/folder symbols with LSD, you'll probably need to install some special fonts. - You can use `fzf` and `ripgrep` together.
In Useful built-in macOS command-line utilities
The original comment said nothing about modifying servers or AWS engineers installing random shit. That was you. I responded to "moving binaries around," and you started yapping about change management. Two totally different things. Like obviously if you have a locked down environment, then only install what you need. But this is not what the original poster was referring to specifically. ripgrep even specifically calls out this exact use case right in its README: https://github.com/BurntSushi/ripgrep/?tab=readme-ov-file#wh... > You need a portable and ubiquitous tool. While ripgrep works on Windows, macOS and Linux, it is not ubiquitous and it does not conform to any standard such as POSIX. The best tool for this job is good old grep. So, you presume too much friendo. Now, go away.
In fd - A simple, fast and user-friendly alternative to 'find'
> PowerShell has up-front required prerequisites that you can declare Anyone who's written more than a few scripts for others will have learned to do something like this at the start: declare -a reqs reqs+=(foo bar baz) missing=0 for r in "${reqs[@]}"; do if (! command -v "$r" &>/dev/null); then echo "${r} is required, please install it" missing=1 fi done if [ $missing -gt 0 ]; then exit 1 fi > Your script is very bravely trying to parse output that includes many different protocols, including: tcp, tcp6, udp, udp6, and unix domain sockets They probably didn't know you could specify a type. Mine only displays TCP4. > Now imagine putting your script side-by-side with the PowerShell script, and giving it to people to read. I'm gonna gatekeep here. If you don't know
Read the rest
what that script would do, you have no business administering Linux for pay. I'm not saying that in a "GTFO noob" way, but in a "maybe you should know how to use your job's tools before people depend on you to do so." None of that script is using exotic syntax. > Note that you had to use 'awk', which is a parser, and then three uses of 'grep' -- a regular expression language, which is also a kind of parsing. They _chose_ to. You _can_ do it all with awk (see my example in a separate post). > Literally in every discussion about PowerShell there's some Linux person who's only ever used bash complaining that PS syntax is "weird" or "hard to read". What are they talking about!? It's half the complexity for the same functionality, reads like English, and doesn't need write-only hieroglyphics for parameters. And yet somehow, bash and its kin continue to absolutely dominate usage. There is a reason that tools like ripgrep [0] are beloved and readily accepted: they don't require much in the way of learning new syntax; they just do the same job, but faster. You can load your local machine up with all kinds of newer, friendlier tools like fd [1], fzf[2], etc. – I definitely love fzf to death. But you'd better know how to get along without them, because when you're ssh'd onto a server, or god forbid, exec'd into a container built with who-knows-what, you won't have them. Actually, that last point sparked a memory: what do you do when you're trying to debug a container and it doesn't have things like `ps` available? You iterate through the `/proc` filesystem, because _everything is a file._ THAT is why the *nix way exists, is wonderful, and is unlikely to ever change. There is always a way to get the information you need, even if it's more painful. [0]: https://github.com/BurntSushi/ripgrep [1]: https://github.com/sharkdp/fd [2]: https://github.com/junegunn/fzf
In Techniques I use to create a great user experience for shell scripts
camgunz·Sep 11, 2024Recommendation phrase
Yeah I love that ripgrep has a different opinion on UX than grep (your "Can ripgrep replace grep" FAQ is great [0]) if only because the thought you put into it makes me also start thinking about those issues, which is fun. Like, maybe at first you balk at ripgrep not honoring locales, but then I was like, "wait why would I ever, ever want that". This is the kind of, I don't know, joy? Epiphany? Expansion? ... that we get from people like you just building a thing you think is good. [0]: https://github.com/BurntSushi/ripgrep/blob/master/FAQ.md#can...
In The Modern CLI Renaissance
Oh... I see the problem. It's probably the thread heuristic. When running gg and rg, make sure -T and -j, respectively, are set to the same number. Because I think gg always defaults to `4`. Where as ripgrep is probably defaulting to a higher number. On very small corpora, like curl, this can actually lead to overall slower times due to the overhead of starting the threads. This also explains why the times are faster on Linux. My Linux workstation has a lot more CPUs than my M2 mac mini. My mac mini has 8 logical CPUs while my Linux box has 24. ripgrep won't necessarily start one thread per core, but at 8 cores, it will indeed start one thread per core. Where as gg will start 4. You can see ripgrep's heuristic here: https://github.com/BurntSushi/ripgrep/blob/e0f1000df67f82ab0... I suppose thread count heuristics are fair game for benchmar
Read the rest
ks, but in order to measure those better, you need a bigger variety of corpus sizes. Even with the Linux kernel, the difference between 4 and 8 threads for `gg` is not that big: $ hyperfine "gg -T4 '[A-Z]+_NOBODY'" "gg -T8 '[A-Z]+_NOBODY'" Benchmark 1: gg -T4 '[A-Z]+_NOBODY' Time (mean ± σ): 364.3 ms ± 2.5 ms [User: 331.1 ms, System: 1108.6 ms] Range (min … max): 360.8 ms … 369.1 ms 10 runs Benchmark 2: gg -T8 '[A-Z]+_NOBODY' Time (mean ± σ): 349.3 ms ± 3.1 ms [User: 454.2 ms, System: 2056.2 ms] Range (min … max): 345.4 ms … 355.8 ms 10 runs Summary gg -T8 '[A-Z]+_NOBODY' ran 1.04 ± 0.01 times faster than gg -T4 '[A-Z]+_NOBODY' But go to a bigger corpus and a difference becomes much more apparent: $ hyperfine "gg -T4 '[A-Z]+_NOBODY'" "gg -T8 '[A-Z]+_NOBODY'" Benchmark 1: gg -T4 '[A-Z]+_NOBODY' Time (mean ± σ): 16.777 s ± 0.351 s [User: 1.868 s, System: 12.301 s] Range (min … max): 16.376 s … 17.396 s 10 runs Benchmark 2: gg -T8 '[A-Z]+_NOBODY' Time (mean ± σ): 10.273 s ± 0.628 s [User: 1.931 s, System: 12.215 s] Range (min … max): 8.980 s … 11.066 s 10 runs Summary gg -T8 '[A-Z]+_NOBODY' ran 1.63 ± 0.11 times faster than gg -T4 '[A-Z]+_NOBODY' This is on a checkout of the Chromium repository. The increased variety of benchmarks is important here because you might have a simpler heuristic for thread count that does result in overall marginally faster times in some cases, but this obscures what you're giving up: substantially slower times in other cases. Moreover, the cases where 4 versus 8 threads results in faster times for 4 threads tend to have very small absolute differences. i.e., Not hugely perceptible by humans.
In Show HN: A somewhat faster, more lightweight, ripgrep-inspired alternative
tokio and serde are certainly not the only ones. You can put almost all of my crates into that category too. The problem with your framing is that you look at this as a "dependency addiction." But that doesn't fully explain everything. The `regex` crate is a good case study. If it were a C library, it would almost certainly have zero dependencies. But it isn't a C library. It exists in a context where I can encapsulate separately versioned libraries as dependencies with almost no impact on users of `regex`. Namely, it has two required dependencies: regex-syntax and regex-automata. It also has two optional dependencies: memchr and aho-corasick. This isn't a case of the regex crate farming out its core functionality to other projects. Indeed, it started as a single crate. And I split its code out into separately versioned crates that others
Read the rest
can now use. And this has been a major ecosystem win: * memchr is used in all sorts of projects, and it promises to give you exactly the same implementation of substring search that the regex crate (and also ripgrep) use in your own projects. Indeed, that crate is used here! What would you do instead? If you were in C-land, you'd re-roll all of the specialized SIMD that's in memchr? For x86-64, aarch64 and wasm32 right? If you haven't done that sort of thing before, good luck. That'll be a long ramp-up time. * aho-corasick is packaged as a stand-alone Python library that is quite a bit faster than pyahocorasick: https://pypi.org/project/ahocorasick-rs/ There's tons of other projects on crates.io relying on aho-corasick specifically, separately from how its used inside of `regex`. * regex-syntax gives you a production grade regex parser. More than that, it gives you exactly the same parser used by the regex crate. People have used this for all sorts of things, including building their own regex engine without needing to re-create the parser (which is a significant simplification). * regex-automata gives you access to all of the internal APIs of the regex engine. This is all the stuff that is too complex to put into a general purpose regex library targeting the 99% use case. As far as I know, literally no other general purpose regex engine has ever attempted this because most regex engines are written in C or C++ where you'd be laughed out of the room for suggesting it because dependency management is such a clusterfuck. Yet, this has been a big benefit to other folks. The Yara project uses it for example, and the Helix editor uses it to search discontiguous strings: https://github.com/helix-editor/helix/pull/9422 (Instead of rolling your own regex engine, which is what I believe vim does.) This isn't dependency addiction. This is making use of separately versioned libraries to allow other projects to depend on battle tested components independent of their primary use case. Yet, if people repeat this kind of process---exposing internals like I did with the regex crate---then you wind up with a bigger dependency tree. Good dependency management is a trade-off. One the one hand, it enables the above to happen, which I think is an objectively Good Thing. But it also enables folks to depend on huge piles of code so easily that it actively discourages someone from writing their own base64 implementation. But as should be obvious, it doesn't prevent them from doing so: https://github.com/BurntSushi/ripgrep/blob/ea99421ec896fcc9a... Good dependency management is Pandora's box. It has been opened and it is never going to get closed again. Just looking on and calling it an addiction isn't going to take us anywhere. Instead, let's look at it as a trade-off.
In I sped up serde_json strings by 20%
I just tried this myself and I did not have a painless experience. Hah. Without the `musl` Archlinux package installed, I get this: --- stderr configure: error: in `/home/andrew/rust/ripgrep/target/x86_64-unknown-linux-musl/release/build/jemalloc-sys-b7d053053989ba56/out/build': configure: error: C compiler cannot create executables See `config.log' for more details thread 'main' panicked at /home/andrew/.cargo/registry/src/index.crates.io-6f17d22bba15001f/jemalloc-sys-0.5.4+5.3.0-patched/build.rs:351:9: command did not execute successfully: cd "/home/andrew/rust/ripgrep/target/x86_64-unknown-linux-musl/release/build/jemalloc-sys-b7d053053989ba56/out/build" && CC="musl-gcc" CFLAGS="-O3 -ffunction-sections -fdata-sections -fPIC -gdwarf-4 -fno-omit-frame-pointer -m64 -static -Wall" CPPFLAGS="-O3 -ffunctio
Read the rest
n-sections -fdata-sections -fPIC -gdwarf-4 -fno-omit-frame-pointer -m64 -static -Wall" LDFLAGS="-O3 -ffunction-sections -fdata-sections -fPIC -gdwarf-4 -fno-omit-frame-pointer -m64 -static -Wall" "sh" "/home/andrew/rust/ripgrep/target/x86_64-unknown-linux-musl/release/build/jemalloc-sys-b7d053053989ba56/out/build/configure" "--disable-cxx" "--enable-doc=no" "--enable-shared=no" "--with-jemalloc-prefix=_rjem_" "--with-private-namespace=_rjem_" "--host=x86_64-unknown-linux-musl" "--build=x86_64-unknown-linux-gnu" "--prefix=/home/andrew/rust/ripgrep/target/x86_64-unknown-linux-musl/release/build/jemalloc-sys-b7d053053989ba56/out" expected success, got: exit status: 77 Notice, in particular, that there is `CC=musl-gcc` in the error above. But: $ which musl-gcc musl-gcc not found I think the spoiler here is the fact that ripgrep uses jemalloc when you build with musl on 64-bit: https://github.com/BurntSushi/ripgrep/blob/c9ebcbd8abe48c833... If you comment out those lines and remove the `jemallocator` dependency from `Cargo.toml`, then the build succeeds. I imagine you'll run into this same problem if you enable ripgrep's `pcre2` feature. However, after installing the `musl` Archlinux package (which provides `musl-gcc`, among other things of course), then the above command builds just fine. Including with `jemallocator` or even with the `pcre2` feature enabled.
In Swift Static Linux SDK
hiAndrewQuinn·Apr 11, 2024Recommendation phrase
Basic code searching skills seems like something new developers are never explicitly taught, but which is an absolutely crucial skill to build early on. I guess the knowledge progression I would recommend would look something kind this: - Learning about Ctrl+F, which works basically everywhere. - Transitioning to ripgrep https://github.com/BurntSushi/ripgrep - I wouldn't even call this optional, it's truly an incredible and very discoverable tool. Requires keeping a terminal open, but that's a good thing for a newbie! - Optional, but highly recommended: Learning one of the powerhouse command line editors. Teenage me recommended Emacs; current me recommends vanilla vim, purely because some flavor of it is installed almost everywhere. This is so that you can grep around and edit in the same window. - In the same vein, moving back from ripgr
Read the rest
ep and learning about good old fashioned grep, with a few flags rg uses by default: `grep -r` for recursive search, `grep -ri` for case insensitive recursive search, and `grep -ril` for case insensitive recursive "just show me which files this string is found in" search. Some others too, season to taste. - Finally hitting the wall with what ripgrep can do for you and switching to an actual indexed, dedicated code search tool.
In Code search is hard
The world has moved on though to opinionated tools, and Rust isn't even the furthest in that direction (That would be Go). The equivalent of those two lines in Cargo.toml would be this example of a basic configuration from the jacoco-maven-plugin: https://www.jacoco.org/jacoco/trunk/doc/examples/build/pom.x... - That's 40 lines in the <plugin> section to do the "defaults". Yes, you could add a load of config for files to include/exclude from coverage and so on, but the idea that that's a norm is way more common in Java projects than other languages. Like here's some example Cargo.toml files from complicated Rust projects: Servo: https://github.com/servo/servo/blob/main/Cargo.toml rust-gdext: https://github.com/godot-rust/gdext/blob/master/godot-core/C... ripgrep: https://github.com/BurntSushi/ripgrep/blob/master/Cargo.toml socketio: https
Read the rest
In Modern Java/JVM Build Practices

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.