LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   changing group (https://www.linuxquestions.org/questions/linux-newbie-8/changing-group-362407/)

twallstr 09-11-2005 02:14 PM

changing group
 
I have a question about changing the group owner of a folder and the files in it.
I have a user, thomas, and a folder named folder1. This folder with the files in it is initially owned by user and group thomas. I want to change the group to "special" so I use the chgrp command like;
chgrp -R special folder1.
Here everything looks OK as both folder and files in it all have a new group owner, "special".
What confuses me is if user thomas now creates another file in "folder1" it does not get the group owner special but rather thomas.
Can anybody please exlplain why this is so and what I can do so that all new files saved in folder1 inherite the group special.

Thank you!

twallstr.

Tinkster 09-11-2005 02:44 PM

That's default behaviour. To get the perms on the newly
created files to be the groups by default you'll have to make
the directory folder1 SETGID.

chmod -R g+s folder1


Cheers,
Tink

Matir 09-11-2005 03:00 PM

While tinkster probably has a far better knowledge than I do, I would think using -R on that chmod command might have potential problems on files. I would just do chmod g+s for each directory. But maybe I'm off base here.


All times are GMT -5. The time now is 06:58 AM.