News for hackers. Stuff that matters.
Re:Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift ... by 3PS on Thursday November 30, 2023 @11:48AM (#38475714)
If you're a fan of the -g flag to ripgrep then I also recommend checking out the -t flag, short for --type, which lets you search specific file types. You can see the full list with `rg --type-list`. For example, you could just search .cs files with `rg -tcs`.

This flag is especially convenient if you want to search e.g. .yml and .yaml in one go, or .c and .h in one go, etc.

Re:Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift ... by hhda on Thursday November 30, 2023 @12:36PM (#38476342)
Thanks, I didn't know about `-t`, I'll read up on it.
Re:Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift ... by kzrdude on Thursday November 30, 2023 @12:09PM (#38475969)
-t is useful but -g doesn't require lookup in help first. Maybe the worse is better principle?
Re:Ripgrep is faster than grep, ag, Git grep, ucg, pt, sift ... by 3PS on Thursday November 30, 2023 @12:16PM (#38476058)
Tbh I've always just typed -t followed by something that feels intuitive and it's always worked. Never really bothered looking in help until I made the above comment.