title: How to find/grep all paths where directory name matches "x" but not "y" on *nix?
body: <p>I have a folder structure like this (which is a small snippet):</p>
  
  <pre><code>└── test
      └── cases
          └── model
              ├── client
              │   ├── socketsTest.coffee
              ├── server
              │   └── socketsTest.coffee
              └── shared
                  └── findersTest.coffee
  </code></pre>
  
  <p>The question is, how do you list all paths that end in <code>.coffee</code> and don't exist in the <code>client</code> folder?</p>
  
  <p>The following command returns all files matching <code>.coffee</code> that exist in the <code>server</code> folder:</p>
  
  <pre><code>find test -name "*Test.coffee" | egrep '/*server*/'
  </code></pre>
  
  <p>But what I really need is a regex that matches everything <strong>except</strong> what's in the client folder.</p>
  
  <p>What is the cleanest way to do this on *nix? The end goal is to return files not inside a <code>client</code> folder, so for the above tree that would be:</p>
  
  <pre><code>$ &lt;find files except those a client folder&gt;
  test/cases/model/server/socketsTest.coffee
  test/cases/model/shared/findersTest.coffee
  </code></pre>
  
  <p>I tried doing something like this but no luck:</p>
  
  <pre><code>find test -name "*Test.coffee" | egrep '*model/[^client]*'
  </code></pre>