I have a problem understanding some aspects of file permissions. The situation is this:
I created a directory as /to using sudo and then changed it's permissions to drwxrwsr-x. I also changed the group for the directory to "xxx" which exists on my system. I am a member in good standing of group "xxx". My understanding is that I should be able to create files and directories in /to since I am a member of group "xxx".
However when I run the following command I get permission denied when trying to create each file and directory in /to.
cp -r from/* /to
What am I not understanding about this situation? I can obviously fix this particular instance with sudo or by changing the owner, but I want to understand the principles.
Thank you in advance.