Ask HN: Instant realtime grep tool for Linux
I have been searching for an instant, real-time grep tool to search through source code on Linux but I haven't found any application that does this.
I have only found ONE ancient app only available on Windows, called Baregrep.
Is there any app like this but also available for Linux?
9 comments
[ 3.0 ms ] story [ 31.2 ms ] threadOtherwise, if you're searching something large and really absolutely need "real time as I type" as a hard requirement, then you'll not really be looking for a grep per se, but for a tool that builds an inverted index and uses that for searches. So things like Russ Cox's 'codesearch', 'qgrep', 'livegrep' and Sourcegraph.
I think for something like this even grep would be fast enough.
You also haven't specified what kinds of queries you're running. If you're doing simple literal queries like 'rg foobar', then ripgrep is pretty much as fast as you're going to get when it comes to non-indexed search. It uses all your CPU cores. On Intel x86_64, it uses AVX2 to do the substring search for 'foobar'. There's just not much you can do to go faster than that in terms of latency.
As I said, if you have a large corpus, then the only way to get instant search times is through an index. You haven't said why those approaches don't work for you.
> I think for something like this even grep would be fast enough.
Sorry I should have mentioned this before, but I'm the author of ripgrep. I know a thing or two about how fast normal exhaustive search greps can go. :-)
The only issue I'm facing is that I wish for Ripgrep to display me the search results as I type. Similar to how FSearch does it.
So instead of typing a search query and hitting enter in the commandline, I would want to continuously search as I type. I think since Ripgrep is very fast, it would be amazing for this task.
I don't know what FSearch is, so that doesn't help this.
What you want is to pair fzf with ripgrep. There are loads of tutorials out there for how to do it.