4 ms·
+1 Here's why: ag provides sane default and settings for developers. grep is ubiquitous and great, but to do what most developers want it requires some guidanc
by valbaca 7y ago
+1 Here's why:
ag provides sane default and settings for developers. grep is ubiquitous and great, but to do what most developers want it requires some guidance, whereas ag focuses on being what you want most of the time.
What I mean by that is that I enjoy the smart-case sensitivity (as in, if there are not caps in my pattern, then it defaults to case-insensitive but if I have any caps in my pattern, it uses case-sensitive) or fast filename searching with -g or both with -G.
I've tried rg and while it was faster, it also didn't provide as good support for filename searching. Ag is still what I consider "so fast I almost don't believe it"
It's like the 'tldr' command (https://tldr.sh/ https://tldr.sh/). Of course I still use man pages, but having something that gets me what I really need very quickly is important.
Steps:
1. Use ag
2. If ag isn't present, try to install ag
3. If I can't install ag, then use grep or find, no big deal.
ag > ack > grep/find
- burntsushi 7y ago> it also didn't provide as good support for filename searching Could you elaborate on this? Is it because you need to type more? If so, I'd suggest one of two things. 1) use `fd` for searching for files, which is dedicated to that purpose. 2) define `alias rgf="rg --files | rg"` (or similar) and use `rgf foo` just like you would use `ag -g foo`.
- JetSpiegel 7y agoripgrep > > > ag