If I call ag "SomeTest" ~/foo
I get no result, while cd ~/foo; ag "SomeTest"
lists the expected result. How comes?
Asked
Active
Viewed 56 times
0

rknuus
- 118
- 1
- 9
-
Weird. Is this with the same session and user? – fedorqui Jul 16 '15 at 16:02
-
Yes. It's ag version 0.30.0 running in a Debian-wheezy-based LinuxContainer, same user, same shell. – rknuus Jul 16 '15 at 16:05
-
is there any vcs ignores in play here? Add the -U flag to check. Is the foo directory compressed? Add the -z flag to check. – gregory Jan 16 '17 at 06:14
-
Thx for the hints. After having updated my system I can't reproduce it anymore, however. – rknuus Jan 26 '17 at 17:31
1 Answers
0
Perhaps the file you're searching for is in a symbolically linked directory, which ag does not follow unless you instruct to with the -f flag. For example:
$< /tmp/foo
test
$ls -l /tmp/foo
lrwxr-xr-x 1 gregory wheel 18B Jan 16 01:00 /tmp/foo -> /Users/gregory/foo
$ag test ./tmp
$ag -f test ./tmp
tmp/foo
1:test

gregory
- 10,969
- 2
- 30
- 42