Setgid on a file

setgid

If I use setgid (chmod g+s) on a file (not a directory), it turns a dark yellow in the file list (of the particular Linux variant I'm using, anyway). But as far as I know, setgid doesn't actually do anything when applied to non-executable files.

Does it?

And, does anyone have a find command to find all non-directories and remove their setgid bit?

Best Answer

As you suggest, setgid only applies to executable files and directories.

You can

 find -type f -perm /g+s chmod g-s '{}' \;

Just don't do this in /usr/bin!

Related Topic