python@ubuntu:~/Desktop/test$ ls
11.txt 123.txt 12.txt 13.txt 223.txt 323.txt
python@ubuntu:~/Desktop/test$ find ./ -name 1*
find: 路径必须在表达式之前: 123.txt
用法: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec|time] [path...] [expression]
python@ubuntu:~/Desktop/test$ ls
11.txt 123.txt 12.txt 13.txt 223.txt 323.txt
python@ubuntu:~/Desktop/test$ find . -name 1*
find: 路径必须在表达式之前: 123.txt
用法: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec|time] [path...] [expression]
python@ubuntu:~/Desktop/test$ find -name 1*
find: 路径必须在表达式之前: 123.txt
用法: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec|time] [path...] [expression]
python@ubuntu:~/Desktop/test$ find -name 1*
find: 路径必须在表达式之前: 123.txt
用法: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec|time] [path...] [expression]
python@ubuntu:~/Desktop/test$ find . -name 1*
find: 路径必须在表达式之前: 123.txt
用法: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec|time] [path...] [expression]
python@ubuntu:~/Desktop/test$ find ./ -name 1*
find: 路径必须在表达式之前: 123.txt
用法: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec|time] [path...] [expression]
python@ubuntu:~/Desktop/test$ cd ..
解决方法:
find: 路径必须在表达式之前: - BruceLong - 博客园
Linux(ubuntu) 终端 find 要加双引号或单引号
1 人赞同了该文章
find -path “*axel*”
和
find -path '*axel*'
都能找到
./gui/kapt/axel-kapt.1
./gui/kapt/axel-kapt.desktop
./gui/kapt/axel-kapt
./axel.1
./axel.o
./axel.h
./axel
./axelrc.example
./axel_zh_CN.1
./axel.c
但是
find -path *axel*
find: paths must precede expression: axel.1
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec|time] [path...] [expression]find -path "*axel*"
发布于 2020-04-16 10:13
Linux(ubuntu) 终端 find 要加双引号或单引号 - 知乎
亲测这是通用的方式,适合所有情况,不加双引号有的能搜到,比如例程中的vim*,但是有的不加却报警