相关疑难解决方法(0)

为什么我可以找到 *main.o 但不能找到 *.o?

这个是对的:

$ find . -name *main.o
./main.o
Run Code Online (Sandbox Code Playgroud)

那么,为什么我找不到*.o

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

command-line find

19
推荐指数
2
解决办法
1940
查看次数

4
推荐指数
1
解决办法
1885
查看次数

find 命令中通配符的奇怪行为

globbing 是 shell 的一个特性吗?

我学会了如何在 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)

发生什么事?

command-line bash find

3
推荐指数
1
解决办法
1138
查看次数

标签 统计

command-line ×3

find ×3

bash ×1