find 查找多个文件

Combining Primaries With Operators
=======================================

Operators build a complex expression from tests and actions. The
operators are, in order of decreasing precedence:

'( EXPR )'
Force precedence. True if EXPR is true.

'! EXPR'
'-not EXPR'
True if EXPR is false. In some shells, it is necessary to protect
the '!' from shell interpretation by quoting it.

'EXPR1 EXPR2'
'EXPR1 -a EXPR2'
'EXPR1 -and EXPR2'
And; EXPR2 is not evaluated if EXPR1 is false.

'EXPR1 -o EXPR2'
'EXPR1 -or EXPR2'
Or; EXPR2 is not evaluated if EXPR1 is true.
alpine1:~/c/json$ ls
cJSON.c      cJSON.h      car.json     emply.json   json.tar.gz  parse        parse.cc
alpine1:~/c/json$ find . -type f -name "*c" -or -name "*h"
./cJSON.c
./cJSON.h
./parse.cc
alpine1:~/c/json$ find . -type f -regex ".*c\|.*h"
./cJSON.c
./cJSON.h
./parse.cc
alpine1:~/c/json$ find . -type f -regex ".*\(c\|h\)"
./cJSON.c
./cJSON.h
./parse.cc
alpine1:~/c/json$find . -type f ! -name "*c" -a ! -name "*h"
./car.json
./.parse.cc.swp
./emply.json
./parse
./json.tar.gz
alpine1:~/c/json$
 
喜欢 0
分享