title: How to use Bash to find files whose gid != a fixed uid?
body: <p>I'm sure this is pretty basic, but I haven't figured it out yet— how would you use Bash to find all files in a directory for which the file's gid is different than its uid? I tried...</p>
  
  <pre><code>find $dir -user $uid -group !=$uid
  </code></pre>
  
  <p>...and was unsurprised when it didn't work. I haven't ventured beyond single commands with Bash yet, but maybe it's time.</p>