find /var/log/ -type f -name *.log 不返回日志文件列表

sil*_*tar 0 find

相反,它返回以下错误:

find: paths must precede expression: file1.log
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
d41d8cd98f00b204e9800998ecf8427e  -
Run Code Online (Sandbox Code Playgroud)

命令语法有问题吗?

(在尝试这个stackoverflow question的公认答案时遇到了这个问题)

jir*_*rib 5

*在给出 find 命令之前被 shell 扩展,请参阅A Guide to Unix Shell Quoting。因此它必须被引用;使用'*'来代替。