Ned Schneebly
Ned Schneebly

Reputation: 186

Bash/Shell Combine options using find

Using the find command is there a way to combine options:

i.e.

find . -type fd -name "somefile"

Although -type ignores the second option; I'm looking to find only files or directories.

Upvotes: 2

Views: 203

Answers (1)

anubhava
anubhava

Reputation: 785276

You can use -o for OR condition in find:

find . \( -type d -o -type f \) -name "somefile"

Upvotes: 5

Related Questions