Find directories that do not contain a directory?

Posted by erikcw on Server Fault See other posts from Server Fault or by erikcw
Published on 2010-03-12T23:36:40Z Indexed on 2010/03/12 23:37 UTC
Read the original article Hit count: 188

Filed under:
|
|
|

I'm trying to figure out how to use the linux "find" command (or another command that will get the job done) to return a list of file paths/directories that do not contain a directory of a certain name.

~/web/domain1.com/public_html/bar
~/web/domain2.com/public_html/
~/web/domain3.com/public_html/bar
~/web/domain4.com/public_html/

I want all of the paths that don't contain the directory named "bar" (domain2.com and domain4.com). Any idea how I can get find to output such a list?

Thanks!

© Server Fault or respective owner

Related posts about bash

Related posts about find