Does rg -g='glob'
help to overcome "argument list too long" limitations?
#2331
-
I was recently helping someone to filter files matching a pattern. With I'm wondering if using the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I think the surface level answer is "yes." It's definitely true that The other question is whether
In this case, you would need |
Beta Was this translation helpful? Give feedback.
-
Thanks, that's what I was looking for. Sorry for the poor description of the problem. There were no sub-directories. Good to know the glob-pattern to exclude sub-directories. |
Beta Was this translation helpful? Give feedback.
I think the surface level answer is "yes." It's definitely true that
-g/--glob
at least won't run afoul of theargument list too long
problem because the glob is given literally for ripgrep itself to evaluate. But when you do something likerg search *.txt
, that glob is evaluated by the shell (on Unix anyway) and expanded into a list of arguments before invoking ripgrep. So in the latter case, ripgrep doesn't even know a glob was used at all.The other question is whether
-g '*.txt'
and*.txt
are actually equivalent. They are not! Example: