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…
find $dir -user $uid -group !=$uid
…and was unsurprised when it didn’t work. I haven’t ventured beyond single commands with Bash yet, but maybe it’s time.
You can try the following :