Gopal
Gopal

Reputation: 795

excluding directories and it sub directories using find

i have directory structure like

applicationlogic/email/FXMM

under this i have directories like, in need to exclude the funding and it's subdirectories. when i use this command it excludes only the funding not it's subdirect

find applicationlogic/email/FXMM -type d ( ! -name funding )

directories

common/ common/scripts/ money/implementation/ money/scripts/ softmoney/implementation/ softmoney/application/ funding/limits/ funding/pilot/ funding/migration/

Upvotes: 0

Views: 68

Answers (1)

zzk
zzk

Reputation: 1387

find applicationlogic/email/FXMM -name "*funding*" -prune -o -type d -print

Basically, the part before -prune (-name "*funding*")is the test for things you want to prune; the part after -o (-type d) is the normal test for find. and -print is the action.

Upvotes: 1

Related Questions