0

我正在尝试在目录中搜索文本,结果发现以下语法不返回任何结果

ack -i "0xabcdef" ./

ack -i "0xabcdef"

ack -i "0xabcdef" .

虽然以下命令有效

ack -i "0xabcdef" *

有人可以解释为什么会这样吗?* 的意义是什么。我还注意到该目录有符号链接

4

1 回答 1

1

您不必指定要确认的目录。默认情况下,它会深入到当前目录。

我还注意到该目录有符号链接

那么最好的办法是查看手册(man ackack --man)并搜索“链接”。你会发现的第一件事是这个选项:

   --[no]follow
       Follow or don't follow symlinks, other than whatever starting files
       or directories were specified on the command line.

       This is off by default.

这意味着如果你想 ack 跟随符号链接,你需要指定--follow选项。

于 2017-08-02T00:31:08.390 回答