我学会了如何在 find 命令中使用通配符,但今天我看到了一个奇怪的行为。
当我在搜索位置以外的任何地方时,我不需要单引号或双引号进行通配
$ pwd
/home
$ find / -name *c
...
it is ok
Run Code Online (Sandbox Code Playgroud)
但
$ pwd
/
$ find / -name *c
find: paths must precede expression: proc
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
Run Code Online (Sandbox Code Playgroud)
发生什么事?