Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我打电话ag "SomeTest" ~/foo,我没有得到任何结果,而cd ~/foo; ag "SomeTest"列出了预期的结果。怎么会?
ag "SomeTest" ~/foo
cd ~/foo; ag "SomeTest"
也许您正在搜索的文件位于符号链接目录中,除非您使用 -f 标志指示,否则 ag 不会跟随该目录。例如:
$< /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