Reputation: 6322
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.
Upvotes: 1
Views: 3498
Reputation: 185760
You can try the following :
find . \( -uid $UID -a ! -group $UID \) -type f -ls
Upvotes: 3