Bash/Shell使用find组合选项

Ned*_*bly 2 macos bash shell find

使用该find命令可以组合选项:

find . -type fd -name "somefile"
Run Code Online (Sandbox Code Playgroud)

虽然-type忽略了第二种选择; 我想找到只有文件或目录.

anu*_*ava 5

您可以使用-oOR条件中发现:

find . \( -type d -o -type f \) -name "somefile"
Run Code Online (Sandbox Code Playgroud)