It may be a stupid question, but I don't understand a detail about the command chown
. I haven't found any explanation for this detail yet, maybe because it's so obvious to everyone.
When you change a file ownership, you can set a user parameter and a group parameter, using the following basic syntax:
chown <username>:<groupname> <filename>
This syntax allows you to insert into the field a user which belongs to a certain group, and to insert into the field a group. When I learned about the chown command for the first time I thought the groupname must be the same as the user group. But then I found out that the groupname can refer to a different group from the one the user belongs to.
Does this mean that you can set ownership to a user and a group, with the group being unrelated to the user group? If yes, it seems to me that this issue conflicts with what I found here. Or am I just getting confused?
Thank you!
chmod
.