ag and rg not listing files starting with underline, find does

223 Views Asked by At

If I do:

touch _gandalf

And then:

rg --files | grep gandalf | wc -l

or

ag -l -g "" | grep gandalf | wc -l

I get 0 matches as result.


Now if I do a touch gandaf I get 1 match.

Why is that? Does files starting with underline have a similar behaviour as hidden files? Maybe is something on mac's filesystem? As mentioned on the title if I replace ag/rg for find . it works as expected.

1

There are 1 best solutions below

0
On

In my case was my global .gitignore having a clausule to exclude files starting with underlines.

But I think is useful to keep in all this files (as mentioned on the comments):

.gitignore

.ignore

.rgignore

.agignore