Regis May
Regis May

Reputation: 3466

How do I use find to search but exclude certain directories?

How can I advice find not to descend in specific (multiple) directories? I would like to invoke find directly, so no features of bash can be used.

Upvotes: 0

Views: 25

Answers (1)

J. Brown
J. Brown

Reputation: 124

How about find . -name "file.tofind" ! -path "dir/to/exclude/*"?

Upvotes: 1

Related Questions