Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 3 down vote accepted

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!

share|improve this answer

Neither setuid or setgid have any impact on non-executable files.

Their meaning is that they are executed as though run by the owner of the file, not as the user (or group) running them. What would that mean for a non-executable file?

Regarding finding them, see

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.