如何 grep 查找名称以“-”开头的文件?

如何 grep 查找名称以“-”开头的文件?

我已经尝试过这个。

grep -r thanks *                                      slave-iv
grep: invalid option -- '@'
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.

该目录如下所示。它们是来自 pidgin 的日志文件。

ls -1
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]

答案1

哎哟!我在询问后才意识到我的问题不是这个,@而是-这个有效

grep -r thanks -- *   

相关内容