find (1)
linux (1)
sgid (1)

How can I set the SGID bit recursively on all subdirectories only under a directory?

Assuming you want to set the SGID bit  on all subdirectories in the entire directory branch under a directory called "foodir" you can do this:
find foodir -type d -exec chmod g+s {} \;


Add a Comment

NOTE: Comments are moderated and will not show until approved.